Lukhnos gives a talk at a CocoaHeads Taipei talk on January 22, 2009. He talks about the common traits of Cocoa and Cocoa Touch and differences between the two, and shares some thoughts of a developer that does both Mac and iPhone software development.
10. • Main Development Language
• OS and Framework
• Design
• Tools
11. Main Developement Language
• Objective-C
• Child of Smalltalk, sibling of
Ruby
• “C with OO”
• Also, Objective-C++
12. OS and Framework
• Mac OS X essentials
• BSD userland
• CoreFoundation
• Quartz
• Foundation
• Core.+ system components
13. CoreFoundation
• C, refcount-based data type and system service library
• CFTypeRef family: array, dictionary, date, number, string...
• Runloop management, i18n, etc.
• CFNetwork stack
• Quartz and other Core.+ services share the same model
14. Foundation
• The basis of Cocoa (hence “Foundation”)
• All beginning with “NS” prefix (for historical reasons)
• Non-nil containers: NSArray, NSDictionary, NSSet etc.
• NSRunLoop, NSThread, etc., high-level system services
• NSUserDefaults, NSNotificationCenter, app-support
infrastructure
22. Development Limitations
• No external framework
• No automatical garbage collection (GC) !
• Sandbox
• Code signing constraints
• Testing and distribution constraints
24. • Think in Objective-C 2.0
• Different platform for different use
• Maximize shared code base, sweat on platform
details
25. Think in Objective-C 2.0
• @property saves your poor fingers
• Fast enumeration also rocks
• Formal and optional protocol can lead to better design
• Also, in Cocoa, performSelector:onThread: etc. makes life
easier
26. Different Platform and Use
• “Your iPhone is not a Mac Pro”
• Think in bigger picture: Mobile-Web-Desktop integration
27. Shared Code Base?
• Cross-platform way of thinking helpful
• Thinkin 32/64-bit neutral code, Endian-agnostic, encoding-
agnostic, etc.
28. In Essence
• Objective-C is a must
• Know the shared libraries: Foundation, CoreFoundation
• Sweat the minor differences and details