iPhone Development A Web Dev’s Perspective Ben Sandofsky - ben@sandofsky.com
I’m Your Straight Man • I’m a Ruby guy • Put on ad-hoc Yellowpages.com iPhone App Team • Worked with the SDK since Beta 1
The Platform • You must use Objective-C (for now) • Cocoa Touch is the Framework • You must use Xcode
Objective-C • A superset of C • Message Based • Static or Dynamic Typing
Syntax human.h - (void) say:(NSString *)message with:(NSString *)emotion; human.m - (void) say:(NSString *)message with:(NSString *)emotion { NSLog(@”He said %@ with great %@”, message, emotion); } [human say:@”Hello World” with:@”joy”];
What’s good? • Introspection and Pseudo Metaprogramming • Type safety is optional • Clean Syntax
What’s bad? • Rituals: header files, types required in method signatures • Message Verbosity • Memory Management
Memory Management • No Garbage Collector (yet) • Retain/Release Model. (Leaks ahoy!) • Auto-release Pools
The Framework • OO Primitives: NSString, NSNumber, etc • Heavy use of Delegates • Model View Controller
Delegates • Alternative to Subclassing • Override Custom Behavior • Leaner
Views • Layers with subview • Respond to Events and send messages • Pain to set by hand
Interface Builder • Set views and wire up events WYSIWYG • “Freeze” it to a file
Conclusions • There’s a reason iPhone Developers charge $200 an hour. • A lot of it is just “different,” but a lot of it is just hard. • It will get easier as hardware gets faster
iPhone Development A Web Dev’s Perspective Ben Sandofsky - ben@sandofsky.com
Recommend
More recommend