SlideShare une entreprise Scribd logo
1  sur  41
Introduction to OS X development with Cocoa … and how web developers  can cheat George Brocklehurst http://georgebrock.com  @georgebrock on Twitter
Before we start… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is Cocoa? ,[object Object],[object Object],[object Object],[object Object]
Getting Started ,[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Interface only here!
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Class name
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Parent class
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Members
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Methods
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Interface
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Start class implementation
Objective C Syntax: Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Methods with bodies
Objective C Syntax: Methods ,[object Object],[object Object],[object Object]
Objective C Syntax: Methods ,[object Object],[object Object],[object Object],[object Object],Method scope
Objective C Syntax: Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Return type
Objective C Syntax: Methods ,[object Object],[object Object],Method name
Objective C Syntax: Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],Argument type Argument name
Objective C Syntax: Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Properties ,[object Object],[object Object],[object Object]
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Storage method:  assign ,  retain  or  copy
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Access permissions:  readwrite  or  readonly
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Can add other things:  nonatomic ,  getter=…  and  setter=…
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Property variable declaration, must also be declared as a class member
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Tell Objective-C precompiler to make getter & setter
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Sensible syntax! Yay!
Objective C Syntax: Selectors ,[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Selectors ,[object Object],[object Object],[object Object],[object Object],Data type for selectors
Objective C Syntax: Selectors ,[object Object],[object Object],[object Object],[object Object],Macro to create selector
Objective C Syntax: Selectors ,[object Object],[object Object],[object Object],[object Object]
Objective C Syntax: Strings ,[object Object],[object Object],[object Object],[object Object]
Managing Memory ,[object Object],[object Object],[object Object],[object Object]
Managing Memory: Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Managing Memory: Autorelease ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Wasn’t there something about cheating?! ,[object Object],[object Object]
Demo
I Can Haz Questions?
K, Thx, Bai! ,[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
jeffz
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure
Hadziq Fabroyir
 
Lec 42.43 - virtual.functions
Lec 42.43 - virtual.functionsLec 42.43 - virtual.functions
Lec 42.43 - virtual.functions
Princess Sam
 

Tendances (20)

PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
 
Virtual Functions
Virtual FunctionsVirtual Functions
Virtual Functions
 
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 Features
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
 
Introduction to Dart
Introduction to DartIntroduction to Dart
Introduction to Dart
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
Qcon2011 functions rockpresentation_scala
Qcon2011 functions rockpresentation_scalaQcon2011 functions rockpresentation_scala
Qcon2011 functions rockpresentation_scala
 
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
Qcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharpQcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharp
 
Oop2010 Scala Presentation Stal
Oop2010 Scala Presentation StalOop2010 Scala Presentation Stal
Oop2010 Scala Presentation Stal
 
Back to the Future with TypeScript
Back to the Future with TypeScriptBack to the Future with TypeScript
Back to the Future with TypeScript
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
 
Swift, swiftly
Swift, swiftlySwift, swiftly
Swift, swiftly
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure
 
Lec 42.43 - virtual.functions
Lec 42.43 - virtual.functionsLec 42.43 - virtual.functions
Lec 42.43 - virtual.functions
 
C++20 the small things - Timur Doumler
C++20 the small things - Timur DoumlerC++20 the small things - Timur Doumler
C++20 the small things - Timur Doumler
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
C++ Presentation
C++ PresentationC++ Presentation
C++ Presentation
 

En vedette (15)

0[1].Evita
0[1].Evita0[1].Evita
0[1].Evita
 
Brumna Braga
Brumna BragaBrumna Braga
Brumna Braga
 
Fotos super estranhas- um show de Photoshop
Fotos super estranhas- um show de PhotoshopFotos super estranhas- um show de Photoshop
Fotos super estranhas- um show de Photoshop
 
N\'est Pas
N\'est PasN\'est Pas
N\'est Pas
 
0864562- April Fools
0864562- April Fools0864562- April Fools
0864562- April Fools
 
ΤΑ ΑΥΤΑ
ΤΑ ΑΥΤΑΤΑ ΑΥΤΑ
ΤΑ ΑΥΤΑ
 
If i were 22
If i were 22If i were 22
If i were 22
 
Ebooks DIY Example
Ebooks DIY ExampleEbooks DIY Example
Ebooks DIY Example
 
Alar Kolk Visioonist Lahendusteni 2008
Alar Kolk Visioonist Lahendusteni 2008Alar Kolk Visioonist Lahendusteni 2008
Alar Kolk Visioonist Lahendusteni 2008
 
Illusions [Ao Giac]
Illusions [Ao Giac]Illusions [Ao Giac]
Illusions [Ao Giac]
 
0848110 Snowboarding: The Passion of the winter
0848110 Snowboarding: The Passion of the winter0848110 Snowboarding: The Passion of the winter
0848110 Snowboarding: The Passion of the winter
 
Agopuntura E Prestazione Sportiva
Agopuntura E Prestazione SportivaAgopuntura E Prestazione Sportiva
Agopuntura E Prestazione Sportiva
 
Vestits
VestitsVestits
Vestits
 
debugging server with strace
debugging server with stracedebugging server with strace
debugging server with strace
 
Fabric Essentials
Fabric EssentialsFabric Essentials
Fabric Essentials
 

Similaire à Cocoa for Web Developers

Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
Connex
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
Muhammad Abdullah
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
arjun431527
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Howard Lewis Ship
 
Presentation 3rd
Presentation 3rdPresentation 3rd
Presentation 3rd
Connex
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
Sunny Shaikh
 
Objective c
Objective cObjective c
Objective c
Stijn
 
C++totural file
C++totural fileC++totural file
C++totural file
halaisumit
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmers
Mark Whitaker
 

Similaire à Cocoa for Web Developers (20)

Objective c
Objective cObjective c
Objective c
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
 
iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
 
201005 accelerometer and core Location
201005 accelerometer and core Location201005 accelerometer and core Location
201005 accelerometer and core Location
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
 
iOS Application Development
iOS Application DevelopmentiOS Application Development
iOS Application Development
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
Presentation 3rd
Presentation 3rdPresentation 3rd
Presentation 3rd
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
 
Objective c
Objective cObjective c
Objective c
 
Synapseindia dot net development
Synapseindia dot net developmentSynapseindia dot net development
Synapseindia dot net development
 
Objective c beginner's guide
Objective c beginner's guideObjective c beginner's guide
Objective c beginner's guide
 
C++ tutorial
C++ tutorialC++ tutorial
C++ tutorial
 
C++totural file
C++totural fileC++totural file
C++totural file
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmers
 
麻省理工C++公开教学课程(二)
麻省理工C++公开教学课程(二)麻省理工C++公开教学课程(二)
麻省理工C++公开教学课程(二)
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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...
 
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
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Cocoa for Web Developers

  • 1. Introduction to OS X development with Cocoa … and how web developers can cheat George Brocklehurst http://georgebrock.com @georgebrock on Twitter
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. Demo
  • 40. I Can Haz Questions?
  • 41.