Between Cocoa and Cocoa Touch: A Comparative Introduction
Upcoming SlideShare
Loading in...5
×
 

Between Cocoa and Cocoa Touch: A Comparative Introduction

on

  • 8,220 views

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 ...

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.

Statistics

Views

Total Views
8,220
Views on SlideShare
8,204
Embed Views
16

Actions

Likes
2
Downloads
107
Comments
1

1 Embed 16

http://www.slideshare.net 16

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • More here...

    http://www.cocoadev.com/index.pl?UIKit
    http://www.cocoadev.com/index.pl?AppKit
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Between Cocoa and Cocoa Touch: A Comparative Introduction Between Cocoa and Cocoa Touch: A Comparative Introduction Presentation Transcript

  • 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 disruptive technology
  • 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 components
  • 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
  • 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
  • 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 • Connectivity/ubiquitity
  • 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 paradigm in iPhone SDK
  • Development Limitations • No external framework • No automatical garbage collection (GC) ! • Sandbox • Code signing constraints • Testing and distribution constraints
  • Some Things We’ve Learned
  • • Think in Objective-C 2.0 • Different platform for different use • Maximize shared code base, sweat on platform details
  • 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
  • Different Platform and Use • “Your iPhone is not a Mac Pro” • Think in bigger picture: Mobile-Web-Desktop integration
  • Shared Code Base? • Cross-platform way of thinking helpful • Thinkin 32/64-bit neutral code, Endian-agnostic, encoding- agnostic, etc.
  • In Essence • Objective-C is a must • Know the shared libraries: Foundation, CoreFoundation • Sweat the minor differences and details
  • Question & Answer