SlideShare ist ein Scribd-Unternehmen logo
1 von 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]

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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++公开教学课程(二)
 

Kürzlich hochgeladen

+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
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
+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...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
"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 ...
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

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.