Between Cocoa and Cocoa Touch:
A Comparative Intro
lukhnos
Lithoglyph Inc.
2009-01-22
Topics Covered

•3   Essential Facts

• History

• What’s    in Common

• What’s    Different

• Migration   Paths
Three Essential Facts
• Cocoa   and Objective-C go together

• You   need to know Foundation (NS.+) classes

• App   Store on iPhone is the disr...
History
NEXTSTEP
   1989-1995
Mach, Objective-C
The “NS-” prefix
Mac OS X
 1999-present
 BSD userland
   Quartz
   Carbon
    Cocoa
iPhone OS
        2007
  OS X under hood
Desktop-grade services
What’s in Common
• Main    Development Language

• OS   and Framework

• Design

• Tools
Main Developement Language

• Objective-C

• Child   of Smalltalk, sibling of
 Ruby

• “C   with OO”

• Also, Objective-C++
OS and Framework

• Mac   OS X essentials

• BSD   userland

• CoreFoundation

• Quartz

• Foundation

• Core.+   system c...
CoreFoundation

• C, refcount-based        data type and system service library

• CFTypeRef   family: array, dictionary, ...
Foundation

• The    basis of Cocoa (hence “Foundation”)

• All   beginning with “NS” prefix (for historical reasons)

• No...
Design

• Bundle

• Internationalization

• Design   patterns

  • delegate

  • notification

  • target/action   model
Tools


• gcc

• Xcode

• Interface   Builder

• Instrument
What’s Different?
• Device   Characteristics

• System   Limitations

• SDK   Differences

• Development    Limitations
Device Characteristics

• Screen   estate

• Nature   of events

• Usage, context, depth   v.s.
 shallowness

• Connectivi...
System Limitations


• Memory     footprint

• App   lifecycle

• Sandbox

• No   inter-app communication
SDK Differences


• AppKit   v.s. UIKit

• NSWindow/NSView         v.s. unified UIView model

• Better, re-inforced   MVC p...
Development Limitations

• No   external framework

• No   automatical garbage collection (GC) !

• Sandbox

• Code   sign...
Some Things We’ve Learned
• Think   in Objective-C 2.0

• Different   platform for different use

• Maximize    shared code base, sweat on platform
...
Think in Objective-C 2.0

• @property      saves your poor fingers

• Fast   enumeration also rocks

• Formal     and optio...
Different Platform and Use



• “Your   iPhone is not a Mac Pro”

• Think   in bigger picture: Mobile-Web-Desktop integrat...
Shared Code Base?



• Cross-platform   way of thinking helpful

• Thinkin 32/64-bit neutral code, Endian-agnostic, encodi...
In Essence


• Objective-C   is a must

• Know    the shared libraries: Foundation, CoreFoundation

• Sweat   the minor di...
Question & Answer
Upcoming SlideShare
Loading in...5
×

Between Cocoa and Cocoa Touch: A Comparative Introduction

6,422

Published on

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.

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
  • More here...

    http://www.cocoadev.com/index.pl?UIKit
    http://www.cocoadev.com/index.pl?AppKit
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
6,422
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
113
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide





























  • Between Cocoa and Cocoa Touch: A Comparative Introduction

    1. 1. Between Cocoa and Cocoa Touch: A Comparative Intro lukhnos Lithoglyph Inc. 2009-01-22
    2. 2. Topics Covered •3 Essential Facts • History • What’s in Common • What’s Different • Migration Paths
    3. 3. Three Essential Facts
    4. 4. • Cocoa and Objective-C go together • You need to know Foundation (NS.+) classes • App Store on iPhone is the disruptive technology
    5. 5. History
    6. 6. NEXTSTEP 1989-1995 Mach, Objective-C The “NS-” prefix
    7. 7. Mac OS X 1999-present BSD userland Quartz Carbon Cocoa
    8. 8. iPhone OS 2007 OS X under hood Desktop-grade services
    9. 9. What’s in Common
    10. 10. • Main Development Language • OS and Framework • Design • Tools
    11. 11. Main Developement Language • Objective-C • Child of Smalltalk, sibling of Ruby • “C with OO” • Also, Objective-C++
    12. 12. OS and Framework • Mac OS X essentials • BSD userland • CoreFoundation • Quartz • Foundation • Core.+ system components
    13. 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. 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
    15. 15. Design • Bundle • Internationalization • Design patterns • delegate • notification • target/action model
    16. 16. Tools • gcc • Xcode • Interface Builder • Instrument
    17. 17. What’s Different?
    18. 18. • Device Characteristics • System Limitations • SDK Differences • Development Limitations
    19. 19. Device Characteristics • Screen estate • Nature of events • Usage, context, depth v.s. shallowness • Connectivity/ubiquitity
    20. 20. System Limitations • Memory footprint • App lifecycle • Sandbox • No inter-app communication
    21. 21. SDK Differences • AppKit v.s. UIKit • NSWindow/NSView v.s. unified UIView model • Better, re-inforced MVC paradigm in iPhone SDK
    22. 22. Development Limitations • No external framework • No automatical garbage collection (GC) ! • Sandbox • Code signing constraints • Testing and distribution constraints
    23. 23. Some Things We’ve Learned
    24. 24. • Think in Objective-C 2.0 • Different platform for different use • Maximize shared code base, sweat on platform details
    25. 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. 26. Different Platform and Use • “Your iPhone is not a Mac Pro” • Think in bigger picture: Mobile-Web-Desktop integration
    27. 27. Shared Code Base? • Cross-platform way of thinking helpful • Thinkin 32/64-bit neutral code, Endian-agnostic, encoding- agnostic, etc.
    28. 28. In Essence • Objective-C is a must • Know the shared libraries: Foundation, CoreFoundation • Sweat the minor differences and details
    29. 29. Question & Answer
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×