Rory Blyth – (email@example.com) iPhone development
What do you need to get started?
– A Mac
– Are you sure?
– But I heard…
– you heard wrong
Besides a mac –
– the iPhone SDK
– learn Objective-C
– read Apple’s design guideline docs (they’re really finicky about how your app looks and performs) – not really guidelines – they’re laws and if you don’t follow them your app will get rejected.
You don’t need an iPhone to get started because there’s a simulator. If you want to deploy to your phone you have to have a paid developer account. What if I don’t have an iPhone? The simulator is your frenemy.
What are some of the rules?
– One user app at a time
– No background (user) apps
– Effect the appearance of multitasking – it’s amazing how much attention has to go to restoring state.
– Don’t be a little resource piggy – scrolling tables can take up 45% of cpu. Need to carefully manage memory.
– Gracefully handle interruptions
Where does the magic happen?
– In your sandbox
What’s in my sandbox?
– Your app bundle.
Can I play in other sandboxes?
There is a url mechanism for calling other apps, like the google maps app, passing it a query string.
Native apps vs. web apps – what gives?
If you’re gonna buy an iphone you got it because of the capabilities – not just a browser. A web app will not give you the same level of hardware interaction and richness that the native tools do. Just go native. Do web stuff elsewhere (not sure I agree with Rory here).
He likens building iPhone web apps to connecting a VCR to your HDTV.
– Looks weird – based on smalltalk, but built on c.
– Get header files (.h) and source files (.m)
– Define interface – here’s whay my type is going to do, not the implementation.
– Protcols are basically the same thing as interfaces in .Net and Java.
– id – the “anything goes” type – if you don’t know what the return type will be.
– Posing – swap out an existing class with your own in a sneaky way. “Objective-C lets you blow your foot off”
– Categories – extend existing classes without inheritance
– Properties, etc.
Apple’s Dev tools
– Xcode is the free IDE
– Interface builder to build UI
– these tools are definitely old and weird (based on NextStep), but they work.
The simulator is somewhat limited – don’t have access to all sorts of things that you have on the phone, but it works ok.
In the iPhone world you only get one window – so don’t create a “window-based app” in xcode.
When you’re designing, read the guidelines, and when you have questions, go to your phone and find an app and see how somebody else did it. Because if it’s on your phone it got approved, so it’s a good model.
Objective C doesn’t really have garbage collection – you have to increment and decrement persistence counts for objects. Calls it garbage inspection. Lots of memory leaks in badly written apps.
Shows writing iPhone app with MonoTouch, where he can write iPhone apps in C#, which he prefers. MonoDevelop is the open source IDE.