iPhone App development – part 1
I get the feeling that many who come to Objective-C find it a difficult language. This may be due in part to the App store bandwagon – if which I admit to being a member – but I can’t help but view the language as, well, annoyingly constructed.
While there are a huge number of utility applications around, there are also a large number of apps that, to a greater or lesser degree, are a wrapper around an existing site. It follows that the developers of these apps are used to web scripting languages rather than writing full-blown applications.
Personally speaking, I hadn’t even written Hello, World in C, let alone in Apple’s own flavour. Jumping directly into Apple’s documentation – which can be daunting at the best of times – is a bad idea. Instead, I would recommend learning about some basic C ideas (data types, pointers etc) before getting stuck in to the tutorials.
Here are the main hurdles I came across:
Messaging syntax
Rather than objects calling methods, Obj-C has messages which are sent to receivers. The syntax I found verbose, primarily because of the use of named arguments; I also found the use of variable-length arguments too tricky.
IBOutlets
Not really an Obj-C concept, outlets aren’t particularly well explained in any of the documentation. Simply put, outlets are Obj-C objects that Interface Builder (the visual layout program) can hook into for assigning events and the like.
Releasing memory
I find it crazy that a modern OS doesn’t have an underlying garbage collector for memory management, especially for a device with a limited capacity. Instead, you must release memory for any objects you instantiate yourself – a very alien concept for web programmers.
Framework differences
Lurking in the mountain of documenation is the statement that effectively tells you that several frameworks available to you in the iPhone simulator are not available on the actual device. What the documentation doesn’t warn you about is that even within the core frameworks, your application may build correctly on the simulator but may crash and burn on an actual handset. Secondly, and more importantly, the enrollment process – which you must complete to be able to test on a device – can take up to 3 weeks. Combining these two can mean you write an entire application, only for it to die horribly when you come to beta testing. The upshot? Enroll as soon as you can.
We’re currently working on a flyG iphone app which means we are indulging in imacs in the dept at the mo. I have it working with our web service however it was a massive work around as the SDK doesn’t support SOAP… major flaw just there… you should hash that one up then sell it to me for a modest fee!
October 3rd, 2009 at 3:55 pmI’m getting close to finishing – what started as a fun development has turned into a bit of a pain in the ass!
October 3rd, 2009 at 3:56 pm