Archive for the 'General' Category

Apple Tech Talk

Saturday, November 28th, 2009

I was lucky enough to get an invite to the Apple Tech Talk in London a couple of weeks ago. It was a worth while trip to the big smoke just for some of the snippets of information your get from some of the talks. Sometimes it doesn’t matter how many forums or blogs you read, how many articles or books you scour through, it takes someone talking to make something make sense.

I didn’t take copious notes like many other people did; there were a large number of people sat there typing in to their Mac Books, almost verbatim anything said!

Anyway, here are a few items I scribbled down that may be of interest.

The first two sessions I took were “Effective iPhone App Development” by Lawrence Coopet.

Data Storage
1. When storing config/session states, be careful about writing lots of objects into a dictionary as individual items. Create a session object and write that instead and don’t just write everything to NSUserDefaults.
2. Think about where you store this data… Archive and implement NSCoding.
3. Use SQLite
4. Use CoreData
5. Store sensitive data in the KeyChain. This has the benefit of being able to share between projects – company data – application data.

When Caching data, make sure you place it in the correct place and never hard code your paths to this data.
All the paths are stored in NSPathUtilities.

NSTemporaryDirectory – this will always be cleared and will never be backed up.
NSCacheDirectory – this is saved, can be cleared, but will never be backed up.
NSDocumentsDirectory – never cleared, always backed up.

Choosing the right place for your data will determine how much iTunes has to backup when syncing your device.

Targetting iPhone OS
1. You should ALWAYS set your Base SDK to the most current OS version – ie. currently 3.1.2 – regardless of which OS you are considering deploying to.
2. Set you Deployment Target to the minimum OS you want your app to run on.
3. You should check for presence of OS features in your code. eg use NSClassFromString and respondsToSelector. However do this at the start of your app and set flags accordingly so that you are not taking speed hits during normal app operation. checking straight global C functions is very quick.
eg if ( UISaveVideoAtPathToSavedPhotoAlbum )

Application Flow
1. Stay focused!
2. The best system is generally – List View – Info View – Detail View. Allow the user to choose to drill down on data rather than forcing too much information on them in one go.
3. Always use the 1 screen 1 controller model.
4. Make sure you are not hardcoding references back to other objects in your application. Using the Model Controller View model your controller talks back to your model but your model should never talk directly to your controller. Your controller talks to you view but your view should never talk back to your controller. And you should never every have your view talk directly to your model. If parent communication needs to take place, then implement delegates. This way you can avoid App specific communication paths.
5. Use Delegates
6. Use Notifications through NSNotificationCentre

Memory Management
1. Make use of the measurement tools regularly – checking for leaks and generally memory usage.
2. Under Snow Leopard make use of XCode Static Analysis – it’s a fantastic tool. (BTW: It really is!)
3. Use the 1 controller 1 nib model.

Application Life Cycle
Compatibility
1. Prefix your classnames with your own token to avoid namespace collisions. eg UI, NS etc…
2. Avoid underscores at the start of method names – these are reserved to Apple.

Proper Code Paths
1. Follow correct code paths. eg. You implement drawRect and call setNeedsDisplay. NEVER call drawRect.

Interruptions
Make sure you handle applicationWillResignActive, applicationDidResumeActive, and applicationWillTerminate.

Concurrency
1. Make sure you use the Async API for Networking and Reachability.
2. Use NSTimer – don’t sit around in threads counting down!
3. Use NSOperation and NSOperationQue. Subclass NSOperation and override main.
4. Keep object access confined to one thread.
5. Design out the need to use locking/signalling/syncing
6. Avoid performSelectorInBackground and detachNewThreadSelector – if you are using these then you are doing it wrong. Use NSOperation.

Artist Required

Wednesday, November 11th, 2009

I really do need to find an artist to help me work on iPhone games!!

Please apply….

Deadman Hill

Monday, November 9th, 2009

I have a particular affinity with Deadman Hill. Anyway, Darren managed to find some information about it recently…

Deadman Hill
This is a stretch of the B3078 along a ridge from Godshill The most likely origin of the name is that a gibbet was situated at one time near the junction with the Redlynch road but a more colourful local story tells how in the mid-eighteenth century a smuggler named David Smith, in return for the promise of a free pardon, betrayed his associates including the infamous Captain Diamond. But not all were apprehended and Smith was waylaid near Studley Head by some of Diamond’s crew who had evaded capture. He was dragged down into the valley east of Cunninger Bottom, now known as Deadman Bottom, where his tongue was cut out, he was cruelly beaten and finally hanged from a tree.

Original text taken from New Forest Walks…

November Rain

Sunday, November 8th, 2009

So the whole of September and October passed by without me making a single post to my blog. And indeed half of August and some of November!
There are a few reasons for that. One being that I am extremely busy in the evenings with my current iPhone app. This should change soon as it’s about to get submitted for release. Second being that I can’t blog during the day, because I cannot get access to my site from the office that I currently work at. Thirdly, I have caught a bout of the usual private bloggers disease: nothing of interest to say.

Will endeavour to post more over the coming weeks, even if some of it may be boring tech stuff.

Lords of the Rings

Monday, August 17th, 2009

I’m just coming to the end of The Fellowship of the Ring, and you know…
I don’t think I care…

I first read LOTR about 14 years ago after many false starts. I just could
never get into it. However while I was at SCi we started working on a LOTR
game so I figured I needed to read it. So I did. I remember enjoying it
but not be particularly blown away by it.

I’m listening to it now on audio book and it feels like pulling teeth. I
understand better now why I found it so hard to get into. It’s just so
dull. I always used to say that I found it verbose, that Tolkien liked to
describe too many sunsets. ( NOTE: I’m not sure he ever describes one,
it’s just a figure of speech. ) But now I think that he doesn’t even
describe them well. I still think he’s verbose but I now think that he is
not very flowery. I don’t find myself getting lost in the prose. So I find
myself coming back to the thought that the book needs a really good edit!

I’m not a person that gets hung up on language. I read a variety of
authors. Some are better storytellers than others. Some are better writers
than others.

I always considered Tolkien as a very good writer with a reasonable story.
Now I think I’m going to have to downgrade him to and OK writer with an OK
story! I just find myself now thinking that there is nothing in LOTR that
makes me want to read it again, therefore do I really want to spend the
next 40 hours of my life listening to the the next two books?

All that said, I aspire to be that OK! :)