Innlegg

Viser innlegg med etiketten iOS

Predicates in Core Data

Database programming is all about filtering and sorting tables linked to each other. According to the book Core Data , «Core Data is Apple’s object graph management and persistency framework for iOS, OS X, watchOS, and tvOS.» In a sense, predicates are an object version of the WHERE clause in SQL. Just like NSFetchRequest represent the FROM clause in SQL. I never have had problems with WHERE and FROM in SQL, but the predicate format strings in Core Data has been quite a struggle for me. I don’t think the struggle is only my fault. Predicates should clearly be thought, at least to me, as a method of writing WHERE clauses. Here is some notes from tutplus’ Core Data and Swift: Relationships and More Fetching : let predicate = NSPredicate(format: "%K == %@", "last", "Doe") The predicate format string uses %K (K stands for Key) for the property name and %@ for the value. let predicate = NSPredicate(format: "%K >= %i", ...

6 posts on #iPhone & #iPad Enterprise Resource Programming: Database and PDF-reporting are covered

Bilde
Creating enterprise apps for iPhone and iPad isn't trivial. In @iFacturas we used 21 months to get out the current version. Now I'm diving into enterprise programming myself, in order to find a better way to do it.  If you know me, you also know I'm loving accounting, specially accounting program design. In many years, there has been two important parts of accounting programs, entering data and reports. Entering data has to do with database and database view programming. Reports with the same database and presenting reports, normally on PDF. I've just finished a roundtrip on database and PDF programming, and have documented the process and the source here in 6 blogposts: I may have found the golden egg in #iOS database programming! It's @sensiblecocoa I've earlier told you about that programming iPhone isn't that hard. That was only partly true however. For database programming in iPhon... Update: Hands-on with @sensibleCocoa #...

My #iOS PDF programming posts are coming to and end. This last tells you how to to finish it.

Bilde
I've combined the  iPhone 4 Development Essesials for XCode  Chapters 32 and 33, with    Apple's print tutorial for iOS .   Most of it is wrapped into the following savePdfFile method: - ( IBAction )savePDFFile:( id )sender {     NSString * path = [[ NSBundle mainBundle ] pathForResource : @"sampleData" ofType : @"plist" ];          // get a temprorary filename for this PDF     path = NSTemporaryDirectory ();     self . pdfFilePath = [path stringByAppendingPathComponent :                         [ NSString stringWithFormat : @"%d.pdf" ,                           [[ NSDate date ]                            timeIntervalSince1970 ] ]];          // Prepare the text using a Core Text Framesetter     CFAttributedStringRef currentText = CFAttributedStringCreate ( NULL ,                                                                   ( CFStringRef ) textView . text , NULL );     if (currentText) {         CTFramesetterRef fram...

#iOS programming is too hard to risk the code. A sidestep on using #git and @github to control it.

Bilde
When preparing for the following, and hopefully last, post, I decided to try to store the project in github.com to let you easily share it. That drove my tutorial to an halt. Without really knowing anything, I did a git init and git commit command, and suddenly all my source-files disappeared! I ceratinly had done something wrong, and had to try to learn Git in order to finish my small tutorial. At least I had to use Time Machine to restore the files, and recreate the project using Apple's built-in Git support. During the work I had a lot of help from the website to the book " Pro Git " by Scott Chaconn. He almost succeded in make me understand it. Way better than the "Git for dummies" wikis, which are made for much more advanced pupils than myself. I had to redo my project, marking it for the use of Git. Then I followed the steps in on github help . So now you can get the the PDF-tutorial files at https://github.com/mortjac/PDF-tutorial . In order to get...

#iOS PDF programming is still not that difficult. Now we dive into #PDF itself ;)

In the last post I described how to "draw" on iOS, which served me well in getting me started on iOS PDF programming. Now I will combine  Apple's print tutorial for iOS  and what I've learned about drawing: As with "drawing", writing PDF isn't that complicated if you sit down and decipher it. And    Apple's print tutorial for iOS  does a good job explaining it. But sadly, the tutorial has a bug in this call. The tutorial wrongly writes: currentRange = [self renderPageWithTextRange:currentRange andFramesetter:framesetter]; instead of the correct: currentRange = [self renderPage:currentPage withTextRange:currentRange andFramesetter:framesetter]; So I got this part running pretty well with the following code: - ( IBAction )savePDFFile:( id )sender

#iOS PDF programming isn't that difficult either. The hard part is to know where to start ;)

Bilde
I like to create a PDF file in my iPhone app. I then did spent to much time looking at various PDF framework. I didn't want to reinvent anything, but the frameworks I looked at just made things more complicated. So today I started to do it the Apple way, that's using Quartz 2D framework in iOS SDK. Happily I already have  iPhone 4 Development Essesials for XCode 4  in my Kindle, so I started on Chapters 32 and 33, which gives an introduction and lesson in Quarts 2D programming. I started with drawing lines, rectangles and ended up with ellipses. And the code drawing the image wasn't difficult at all: - ( void )drawRect:( CGRect )rect {     // Setting context     CGContextRef context = UIGraphicsGetCurrentContext ();      // Setting line width      CGContextSetLineWidth (context, 2.0 );      // Setting color      CGContextSetStrokeColorWithColor (context, [ UIColor blueColor ]. CGColor );      // Create a rectangle      CGRect rectangle = CGRectMake ( 60 , 170 , ...

Update: Hands-on with @sensibleCocoa #iOS tableView framework - I see light in the tunnel!

I've got the "Sensible Tableview" installed. I've passed the videos one more time, and now I'm hands-on. Yesterday I tried a small project with some accounting database stuff. But ran into endless problems. So I decided to follow the Core Data video instead, trying to undersand the sensible way . The video however is showing a XCode 3 project, so there are some small differences. And as "the devil is in the details" it is also present here, and I tumbled. But finally I got it right.  XCode4 has a navigation project template with an example database application that runs out of the box. There isn't any editing posibility however. But by adding a bit of @sensibleCocoa magic, you suddenly get it! Update: Somehow I discovered that the project didn't save. From the @sensibleCocoa forum I got immediately an answer that solved the problem. I just had to add the following line to the  applicationDidEnterBackground method in the navTestAppDelegate...

I may have found the golden egg in #iOS database programming! It's @sensiblecocoa

Bilde
I've earlier told you about that programming iPhone isn't that hard. That was only partly true however. For database programming in iPhone is extremly complex. I've spent weeks trying to build a xcode template letting me have it my way, just to stumble, fall, hurt me, sweat and cry. Instead I got a flu, and had to remember my main objective, which was to make accounting programming in iOS, and to see if a template or framework was the right solution. So curing my flu, I starte feverishly (no pun intenteded;) to look for templates and frameworks or people doing these things that could help me.  I added new tabs for ORM, Objective-C, SQLite on Flipboard and Zite, and after endless flips I finally found something: @giminete in Zaragoza seemed the most interesting. But then on Thursday I discovered the " Sensible Cocoa " tableview framework. They promise to build a database app on 5 minutes!  Oh what a joy. I've been through the videos, a bit into the forums...

Mobile Wars

Bilde
iPhone vs. Android | Facebook vs. Groupon... Today I wanted to show you a complete infographic created by Lucid Agency that depicts how the mobile and app market is doing now and how it's supposed to be doing in the upcoming years. A few observations: - Apple is still market leader as far as apps is concerned - Almost 100 million smartphones were sold in the first quarter 2011 - Subscriptions are growing and growing. As you know, iFacturas will be based on a subscription model very soon. Seems this is the most comfortable way to try and trust an app developer. - Loyalty to Apple devices is still higher than Android, but loyalty to this last OS is growing. Are you an iPhoner or a Droider ?

Not without my iPhone

Bilde
Hi everyone. I was a regular feature-phone user until a year and a half ago. In that very moment, my boss, Morten Jacobsen, asked me to become an iPhone user. I was sort of upset at the beginning. I thought I was happy with my regular Nokia. Now I know I wasn’t that happy. Yesterday my iPhone 3GS (my iPhone 4 is already ordered) I tried to fix the screen myself and I totally broke something inside the Apple device. You, up to now, I’ve been living without my iPhone and that has been tough. I couldn’t be “unconnected” for so long, so I borrowed a Nokia E7 from our iFacturas’ office. Nokia E7 is a new smartphone, but let me tell you that is far, far, far from an iPhone user experience!! Sorry for Nokia. This brand had always been my mobile brand. But, I’m suffering a whole lot with this Finnish device. It’s like going back to 1999!!! In fact, it’s being so difficult for me to deal with it, that I’ve borrowed an old iPhone 3G and I’m now transferring all my app to this old iPhone. Sure i...

Google vs. Android Part V - by @Asymco

A post from asymco.com by Horace Dediu has the whole story . Here it is with kind permission: When I began the series of posts on Google vs. Android I put forward some questions about the business logic of Google becoming an operating system supplier, especially as that role can be seen as being counter-productive to Google’s strategy. I noted three strategy costs associated with a zero priced systems software bundle. A  opportunity cost  with other platform vendors, namely Apple who might retaliate against Google’s core business. Versions of the software being  usurped  and modified to provide distribution to Google’s competitors. Damage  to Google’s brand and positioning and negotiating power in relation with other members of their value chain. More fundamentally, Google-as-systems-software is fundamentally asymmetric to Google-as-cloud-software and contradicts  the value proposition that Google enables value in the web not in accessing the web. ...

3 reasons why QuickCam is the best iPhone photo app

Bilde
I've bought 14 photo apps on iPhone of which you can see 12 above here. The two apps I use dayli are QuickCam and Instagram. When I have 3G access, that's when I'm in Norway, I tend to use Instagram most. But when  abroad I use QuickCam. For three reasons: It's starts blistering fast. 1 sec. faster than Apple own photo app. It shoots fast. Well, I just click and there it is. No delay and waiting. It shoots repeated images as fast as a machine gun. So it's all come done to speed, which I find quite interesting as an app developer. And the prize is right - one buck! A post from Two Teeth Technologies by has more : Why QuickCam? As my daughter has grown, I've been amazed by how easy it is to take photographs and videos of her anytime, anywhere.  With a 5MP / HD Video camera in my pocket at all times,  I haven't missed much in her first 17 months.  But I certainly learned the limitations of iPhone camera apps.  The slow startup of the default camer...

Apperian picks up first enterprise iFund payout

Bilde
A post from The Unofficial Apple Weblog (TUAW) by Mike Schramm has the whole story . Here is a part: The iFund has been pretty influential  ever since it was announced a couple years ago  -- it's a pool of money set up by Apple and a few other companies to support and grow companies that are contributing to the iOS ecosystem. It's been  growing along with Apple's platform , and now the fund has made its first contribution to an enterprise developer.  Apperian is a company  that helps enterprises create and deploy their own mobile apps, and it's  picked up $9.5 million in a round of funding  that includes money from the iFund.

A tea party game for you and your grandchildren - on iPad

Bilde
If you ever has played with children you know that inviting their stuffed animals and imaging a small party is big fun. I've just downloaded the game on the iPad and I'm going to invite Aitana and Joan to drink tea with me and their animals ;) A post from Just Another iPad Blog by patrickj has the whole story . Here is a part: Here’s a little more about Toca Tea Party, via its App Store page: FEATURES - Nine types of cakes and cookies to choose from! - New colors for the tableware every time! - Fun sounds when your guests eat! - Clean up after cheeky guests that spill! - Finish by putting everything in the dishes! - Beautiful hand-drawn graphics! - Kid-friendly interface! - NO ADVERTISING - NO IN-APP PURCHASES

Gratulerer Aftenposten! Endelig er dere på iPad.

Bilde
Først VG og så Aftenposten. Endelig. Her er det mye bra og litt jeg savner. Det fine først: Avisen har en hoved-forside og separate forsider for nyheter, verden, økonomi, kultur, meninger og sport. I tillegg finns en avdeling for bilder kalt galleri, og video. Disse under-forsidene gjør det veldig lett å scanne nyhetene. Mye lettere enn på VG. Bra. Annonsene synes jeg også fungerer bedre enn i VG. De bruker ikke så lang tid til å laste, og er ikke så spesielle. Det som mangler er muligheten til å dele til sosiale nettverk og blog. En detalj bare, tenker kanskje du, men for meg er det ikke aktuelt å engang bla i avisa før jeg kan dele fra den. Faktisk er kvaliteten av delingen viktigere for meg enn hvilken avis jeg leser. Dette på tross at jeg er vokst opp med Aftenposten. Til deres forsvar brukte VG+ laang tid på å implementere deling. Ta dere en tur fra Jernbanetorget til Akersgata, så viser de dere sikkert trikset ;) Gratulerer Aftenposten! PS. Har dere en Facebook og Twit...

Legends Of The Fall, Apple Style

Bilde
A huge part of the Apple news in the blogoshere is rumors. Rumors about new not released products or services and possible events. I normally not pass this information on. But MG Siegler is so well informed, that I will let his well written write-up on what to expect from Apple this fall pass to you. A post from TechCrunch by MG Siegler has the whole story . Here is a part:   This past weekend,  we broke the news that iOS 5 , the latest version of Apple’s mobile operating system, was likely being released in the fall. This would break the tradition of a summer release. And we also noted that instead of a separate event in the early spring, Apple was likely to use their WWDC event in June to talk about the new OS for the first time. Sure enough, today  came word from Apple  that seems to verify both things. Apple will host WWDC in San Francisco on June 6 through June 10, they formally  announced  today. The focus of the event? “ At this year’s con...

Predicting iPhone sales for dummies - Update

Bilde
Update:  9to5mac.com notes that if iPhone 5 follows the iPhone pattern described by Dediu, it could sell 100 millions. A post from asymco by Horace Dediu has the original story . Here it is with kind permission: Apple’s second fiscal quarter has just ended. Time for analysts to put forward their predictions for the quarter’s report (due in about 3 weeks.) If history is a guide, the estimates will range quite widely and accuracy will be determined mostly by the ability of an analyst to predict iOS device sales (and iPhone most of all). How hard can it be? It depends on what you choose to prioritize as the proxy for sales. In competitive markets there is usually a constraint on demand and rivalry among suppliers. If that’s your assumption you might want to use samples from the sales channel as a proxy. That means sampling distribution channels and sales through to end users at retail. You might even watch competitors and index them to each other using historic market shares....

How the Sunk Cost Fallacy Feeds FarmVille Addiction and Bad Purchases

Bilde
It took me months to leave Farmville. And yes, I think it was the sunk costs... A post from lifehacker.com by Kevin Purdy  has the whole story . Here is a part: ...Put simply, it's the feeling of "I've already spent X, so I'd better spend Y to salvage it." David McRaney's post makes good sense of how FarmVille is a master manipulator of the sunk cost emotion, but shows how it's hardly contained to pastimes and cheap addictions: Hal Arkes and Catehrine Blumer created an experiment in 1985 which demonstrated your tendency to go fuzzy when sunk costs come along. They asked subjects to assume they had spent $100 on a ticket for a ski trip in Michigan, but soon after found a better ski trip in Wisconsin for $50 and bought a ticket for this trip too. They then asked the people in the study to imagine they learned the two trips overlapped and the tickets couldn't be refunded or resold. Which one do you think they chose, the $100 good vacation, or the ...

Android: Open. Open. Open. Open. Open. Open. Open. Closed.

Bilde
I feel with MG Siegler. It's hard to hear all this talk of that Android is open. Read the whole story! A post from TechCrunch by MG Siegler has the whole story . Here is a part:   I’ve never liked Google’s use of the word “open” to describe the Android operating system. On one hand, the “openness” has led to situations where  carriers can more easily screw consumers . On the other hand, their system is really only “open” when it’s convenient to be. Wanna include Google’s services on your Android device? Sure, sign this partnership agreement. Wanna check in code for Android? Do you work at Google? No. Well then you’ll have to wait. Open.   But still, every chance they get, we hear from Google how open Android is, as if it’s the perfect answer to every question. How are you going to compete with Apple? Open. How are you going to keep the carriers in check? Open. How are you going to make money from Android? Open. Why is the Android experience sub-par? Open.  ...

Report: Apple to expand AirPlay plans

Bilde
Somehow AirPlay doesn't work for video anymore on my Apple TV. There have to be some issues. I've updated both the TV and my devices, but I only get the sound over... A post from The Unofficial Apple Weblog (TUAW) by Mike Schramm has the whole story . Here is a part: Man, I could have told you this one: Bloomberg is reporting that Apple plans to  extend its AirPlay service out even further , licensing it out to television sets that would then be able to receive and display video directly from iDevices -- bypassing the need to plug in an Apple TV and pay $99. Currently, third-party device support for AirPlay only covers audio and certain Airplay-enabled stereo devices, but it's far from a stretch to think that Apple will go to video soon, especially since you can currently stream any iTunes media through the AirPlay protocol. I think we'll go even farther -- the iPad is quickly growing to be as or even  more powerful than your average set-top box or console , and ...