Thought for the week….
“You can't just ask customers what they want and then try to give that to them. By the time you get it built, they'll want something new.” - Steve Jobs

Code4PizzaCollator: The first push.

Posted: January 9th, 2010 | Author: jasonbell | Filed under: code4pizzacollator | No Comments »

An excellent day of coding today as I spent the day hooking up the database storage to the iPhone.  This was all new to me but there’s some good documentation out there.  I used some sample code from Bill Dudney and Chris Adamson’s book “iPhone SDK Development” so I could get used to using SQLite (cos I’m a MySQL kinda guy).

The most useful thing I learned today….. the way that the SDK will copy the SQLite database to a WHOLE new place.  Turns out the insert code was working fine I just didn’t know where it was going.

NSArray *searchPaths =

NSSearchPathForDirectoriesInDomains

(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentFolderPath = [searchPaths objectAtIndex: 0];

dbFilePath = [documentFolderPath stringByAppendingPathComponent:

DATABASE_FILE_NAME];

NSLog(documentFolderPath); is your friend.

So it’s all coming along nicely, the first commit went up to github this afternoon so other people can have a play with it (assuming that you’re all bored with the snow now).  The next job is to bundle up the saved locations and send them to a server (somewhere to be decided).  There’s plenty of resources on getting an iPhone app to pull JSON data in from a URL but not a lot about transmitting it.  This is going to be fun :)



Leave a Reply