SlideShare une entreprise Scribd logo
1  sur  29
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

Contenu connexe

Tendances

Никита Корчагин - Introduction to iOS development
Никита Корчагин - Introduction to iOS developmentНикита Корчагин - Introduction to iOS development
Никита Корчагин - Introduction to iOS development
DataArt
 
android architecture
android architectureandroid architecture
android architecture
Aashita Gupta
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
Clément Escoffier
 

Tendances (20)

iOS Developer Concept introduction
iOS Developer Concept introductioniOS Developer Concept introduction
iOS Developer Concept introduction
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
Beginning Real World iOS App Development
Beginning Real World iOS App DevelopmentBeginning Real World iOS App Development
Beginning Real World iOS App Development
 
basic of Java
basic of Javabasic of Java
basic of Java
 
Android architechture
Android architechtureAndroid architechture
Android architechture
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
Advantages and Opportunities of Cross-Platform Development
Advantages and Opportunities of Cross-Platform DevelopmentAdvantages and Opportunities of Cross-Platform Development
Advantages and Opportunities of Cross-Platform Development
 
Никита Корчагин - Introduction to iOS development
Никита Корчагин - Introduction to iOS developmentНикита Корчагин - Introduction to iOS development
Никита Корчагин - Introduction to iOS development
 
Android Development - Session 1
Android Development - Session 1Android Development - Session 1
Android Development - Session 1
 
I os 101:basic training rajan
I os 101:basic training   rajanI os 101:basic training   rajan
I os 101:basic training rajan
 
Android Media player
Android Media playerAndroid Media player
Android Media player
 
android architecture
android architectureandroid architecture
android architecture
 
Android OS and its Features
Android OS and its FeaturesAndroid OS and its Features
Android OS and its Features
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
 
ANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEMANDROID MOBILE OPERATING SYSTEM
ANDROID MOBILE OPERATING SYSTEM
 
Android Presentation [Final]
Android Presentation [Final]Android Presentation [Final]
Android Presentation [Final]
 
Versions of Android OS
Versions of Android OSVersions of Android OS
Versions of Android OS
 
Android ppt
Android ppt Android ppt
Android ppt
 
ppt based on android technology with great animations
ppt based on android technology with great animationsppt based on android technology with great animations
ppt based on android technology with great animations
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
 

Similaire à Between Cocoa and Cocoa Touch: A Comparative Introduction

Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcamp
ahkjsdcsadc
 
Auto cad 2006_api_overview
Auto cad 2006_api_overviewAuto cad 2006_api_overview
Auto cad 2006_api_overview
scdhruv5
 
Cloud Computing Introduction
Cloud Computing IntroductionCloud Computing Introduction
Cloud Computing Introduction
Adomas Svirskas
 

Similaire à Between Cocoa and Cocoa Touch: A Comparative Introduction (20)

mekentosj.com - building Papers
mekentosj.com - building Papersmekentosj.com - building Papers
mekentosj.com - building Papers
 
Yet Another Max/MSP-Cocoa Communication
Yet Another Max/MSP-Cocoa CommunicationYet Another Max/MSP-Cocoa Communication
Yet Another Max/MSP-Cocoa Communication
 
Couch Db
Couch DbCouch Db
Couch Db
 
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf....NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java
 
QNX, C/C++, Qt, Cascades, HTML5… So what’s now BlackBerry 10 application deve...
QNX, C/C++, Qt, Cascades, HTML5… So what’s now BlackBerry 10 application deve...QNX, C/C++, Qt, Cascades, HTML5… So what’s now BlackBerry 10 application deve...
QNX, C/C++, Qt, Cascades, HTML5… So what’s now BlackBerry 10 application deve...
 
software programs
software programssoftware programs
software programs
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Titanium Desktop Intro
Titanium Desktop IntroTitanium Desktop Intro
Titanium Desktop Intro
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcamp
 
Cv
CvCv
Cv
 
.Net Core
.Net Core.Net Core
.Net Core
 
Session 01 - Introduction to Java
Session 01 - Introduction to JavaSession 01 - Introduction to Java
Session 01 - Introduction to Java
 
Introduction to Java Part-2
Introduction to Java Part-2Introduction to Java Part-2
Introduction to Java Part-2
 
Auto cad 2006_api_overview
Auto cad 2006_api_overviewAuto cad 2006_api_overview
Auto cad 2006_api_overview
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
Cloud Computing Introduction
Cloud Computing IntroductionCloud Computing Introduction
Cloud Computing Introduction
 
Ada at Barco avionics
Ada at Barco avionicsAda at Barco avionics
Ada at Barco avionics
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Between Cocoa and Cocoa Touch: A Comparative Introduction

  • 1. Between Cocoa and Cocoa Touch: A Comparative Intro lukhnos Lithoglyph Inc. 2009-01-22
  • 2. Topics Covered •3 Essential Facts • History • What’s in Common • What’s Different • Migration Paths
  • 4. • Cocoa and Objective-C go together • You need to know Foundation (NS.+) classes • App Store on iPhone is the disruptive technology
  • 6. NEXTSTEP 1989-1995 Mach, Objective-C The “NS-” prefix
  • 7. Mac OS X 1999-present BSD userland Quartz Carbon Cocoa
  • 8. iPhone OS 2007 OS X under hood Desktop-grade services
  • 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
  • 15. Design • Bundle • Internationalization • Design patterns • delegate • notification • target/action model
  • 16. Tools • gcc • Xcode • Interface Builder • Instrument
  • 18. • Device Characteristics • System Limitations • SDK Differences • Development Limitations
  • 19. Device Characteristics • Screen estate • Nature of events • Usage, context, depth v.s. shallowness • Connectivity/ubiquitity
  • 20. System Limitations • Memory footprint • App lifecycle • Sandbox • No inter-app communication
  • 21. SDK Differences • AppKit v.s. UIKit • NSWindow/NSView v.s. unified UIView model • Better, re-inforced MVC paradigm in iPhone SDK
  • 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

Notes de l'éditeur