SlideShare a Scribd company logo
Developing for iOS
What is developing for iOS? 
• The language – Objective-C but most recently 
Swift 
• The tools – Xcode mostly 
• The concepts - MVC 
• The frameworks (libraries) - Cocoa touch (for 
iOS) is the API: Foundation and UIKit, and 
many others
Intro to Object Oriented Programming 
What is it and why use it? 
A programming paradigm. Wraps up state and 
behavior into one package. Make “blueprints” for 
creating objects. Objects are abstract data types. 
State = instance variables. The ‘nouns’ of an object. 
What exactly is the object and what does it 
represent? 
Behavior = methods. The ‘verbs’ of a object. What 
does the object actually do?
Why OO programming? 
• Modularity: Program can be broken into pieces. 
• Abstraction: Hide the details. 
• Maintenance. Don’t have to modify existing 
objects as long as you interface with them 
properly. 
• Reuse. Many objects do the same functionality. 
So why write more code? Just instantiate more 
instances of an object.
What is a class? 
• Class is a “template” or “blueprint” that is 
used to create objects. 
• Describes the behavior and properties 
common to any particular type of object. 
• You use a class to instantiate an instance of an 
object.
Object Oriented Concepts 
• Abstraction: Hide the details of the 
implementation and just deal with “what” 
instead of “how”. 
• Encapsulation : Enforces modularity. Wrapping 
up data members and method together into a 
single unit. Protect the object from other 
objects. 
• Inheritance 
• Polymorphism
OO Concepts: Inheritance 
Objects can acquire the properties of another class. Promotes 
reusability of code by using existing code from parent class. Child 
class adopts parent class features and has its own features. 
Note the inheritance: 
All animals eat and sleep 
but the child classes have their 
own unique behaviors as well.
OO Concepts: Polymorphism 
• Polymorphism: The ability of different objects to 
respond, each in its own way, to identical 
messages is called polymorphism. Note: All these 
shapes will draw but of course they’re 
implemented in different ways.
Intro to Objective-C 
• Objective-C is a super set of C. 
• Objective-C is also known for its verbose 
naming conventions. 
• Designed to be reader friendly for humans. 
• Developed by NextStep. Company created by 
Steve Jobs after he was kicked from Apple. 
• Objects everywhere. 
• Objective-C is decidedly more dynamic, 
deferring most of its decisions to run-time 
rather than compile-time.
Some Objective-C Data Types 
• Some common data types: 
• NSString *myString = nil; 
• NSString *aString = @"Hello”; 
• NSArray *myArray = @[object1, object2, object3]; 
• NSNumber *num = [[NSNumber alloc] initWithFloat:3.6]; 
• id = Hold a reference to any object. 
Notice the pointers (*) everywhere. Object 
instantiation galore. This has to do with Obj-C’s 
runtime. Obj-C is a very dynamic language. So it throws 
everything on the heap and just points to the objects.
Method Examples
“Calling a method” vs “Sending a 
message” 
• Theoretically, they're different but in practice they’re 
not. Difference comes from the Objective-C runtime. 
• Most compiled languages refer to methods and 
functions internally as memory offsets where the 
method resides. This has the advantage of being very 
fast. The starting point is known at compile-time. 
• Objective-C runtime maintains a list of all methods and 
functions. This allows for dynamic behavior by allowing 
us to modify what section of code a method executes, 
not responding to a message, or introspection. 
• 99% of the time sending a message to an object will call 
the method intended. So in practice there’s not much 
difference.
Basic Objective-C Header file 
Notice the import of Foundation. Foundation gives basic 
functionality for things like NSString, NSArray, NSObject, etc. It will 
be automatically imported to your classes when you create a new 
class file in Xcode. 
All objects will inherit from NSObject. Just do it.
Book Implementation File
Model View Controller: 
An architectural pattern for organizing your code. Commonly used when implementing UI. 
Watch this video: http://bit.ly/Zjsic2 (Stanford University Developing iOS 7 Apps: Lecture 1)

More Related Content

What's hot

Intro Ruby Classes Part I
Intro Ruby Classes Part IIntro Ruby Classes Part I
Intro Ruby Classes Part I
Juan Leal
 
Metaprogramming with javascript
Metaprogramming with javascriptMetaprogramming with javascript
Metaprogramming with javascript
Ahmad Rizqi Meydiarso
 
Thinking Like a Programmer
Thinking Like a ProgrammerThinking Like a Programmer
Thinking Like a Programmer
Cate Huston
 
12. Objects I
12. Objects I12. Objects I
12. Objects I
Joseph Murphy
 
Python and web driver
Python and web driverPython and web driver
Python and web driver
Colm Harrington
 
Cs8392 u1-1-oop intro
Cs8392 u1-1-oop introCs8392 u1-1-oop intro
Cs8392 u1-1-oop intro
Rajasekaran S
 
Type script
Type scriptType script
Type script
Zunair Shoes
 
Unit 2
Unit 2Unit 2
Code reviews
Code reviewsCode reviews
Code reviews
Roger Xia
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
রাকিন রাকিন
 
Classes And Objects
Classes And ObjectsClasses And Objects
Classes And Objects
rahulsahay19
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwords
ramesh517
 
java Basic Programming Needs
java Basic Programming Needsjava Basic Programming Needs
java Basic Programming Needs
Raja Sekhar
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
Manas Rai
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Ruby on Rails: a brief introduction
Ruby on Rails: a brief introductionRuby on Rails: a brief introduction
Ruby on Rails: a brief introduction
Luigi De Russis
 

What's hot (16)

Intro Ruby Classes Part I
Intro Ruby Classes Part IIntro Ruby Classes Part I
Intro Ruby Classes Part I
 
Metaprogramming with javascript
Metaprogramming with javascriptMetaprogramming with javascript
Metaprogramming with javascript
 
Thinking Like a Programmer
Thinking Like a ProgrammerThinking Like a Programmer
Thinking Like a Programmer
 
12. Objects I
12. Objects I12. Objects I
12. Objects I
 
Python and web driver
Python and web driverPython and web driver
Python and web driver
 
Cs8392 u1-1-oop intro
Cs8392 u1-1-oop introCs8392 u1-1-oop intro
Cs8392 u1-1-oop intro
 
Type script
Type scriptType script
Type script
 
Unit 2
Unit 2Unit 2
Unit 2
 
Code reviews
Code reviewsCode reviews
Code reviews
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
 
Classes And Objects
Classes And ObjectsClasses And Objects
Classes And Objects
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwords
 
java Basic Programming Needs
java Basic Programming Needsjava Basic Programming Needs
java Basic Programming Needs
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Ruby on Rails: a brief introduction
Ruby on Rails: a brief introductionRuby on Rails: a brief introduction
Ruby on Rails: a brief introduction
 

Similar to Intro to iOS: Object Oriented Programming and Objective-C

Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
UmerUmer25
 
Method Swizzling with Objective-C
Method Swizzling with Objective-CMethod Swizzling with Objective-C
Method Swizzling with Objective-C
AdamFallon4
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-C
DataArt
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
RiturajJain8
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
Jessica Deakin
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
umesh patil
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
madan r
 
java oops and java very important for .pptx
java oops and java very important for .pptxjava oops and java very important for .pptx
java oops and java very important for .pptx
cherukuriyuvaraju9
 
java oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptxjava oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptx
CHERUKURIYUVARAJU209
 
130704798265658191
130704798265658191130704798265658191
130704798265658191
Tanzeel Ahmad
 
Introduction To Design Patterns Class 4 Composition vs Inheritance
 Introduction To Design Patterns Class 4 Composition vs Inheritance Introduction To Design Patterns Class 4 Composition vs Inheritance
Introduction To Design Patterns Class 4 Composition vs Inheritance
Blue Elephant Consulting
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
LakshyaChauhan21
 
OOP History and Core Concepts
OOP History and Core ConceptsOOP History and Core Concepts
OOP History and Core Concepts
Nghia Bui Van
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
sagarjsicg
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Sandeep Karthikeyan
 
Ios development
Ios developmentIos development
Ios development
Shakil Ahmed
 
Image Processing and Computer Vision in iPhone and iPad
Image Processing and Computer Vision in iPhone and iPadImage Processing and Computer Vision in iPhone and iPad
Image Processing and Computer Vision in iPhone and iPad
Oge Marques
 
java introduction features and propertie
java introduction features and propertiejava introduction features and propertie
java introduction features and propertie
SanaMateen7
 
Block_1_Unit- I.pdf bca learning for exam you
Block_1_Unit- I.pdf  bca learning  for exam youBlock_1_Unit- I.pdf  bca learning  for exam you
Block_1_Unit- I.pdf bca learning for exam you
vosawe9128
 
Bootstrapping iPhone Development
Bootstrapping iPhone DevelopmentBootstrapping iPhone Development
Bootstrapping iPhone Development
ThoughtWorks
 

Similar to Intro to iOS: Object Oriented Programming and Objective-C (20)

Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
 
Method Swizzling with Objective-C
Method Swizzling with Objective-CMethod Swizzling with Objective-C
Method Swizzling with Objective-C
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-C
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
java oops and java very important for .pptx
java oops and java very important for .pptxjava oops and java very important for .pptx
java oops and java very important for .pptx
 
java oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptxjava oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptx
 
130704798265658191
130704798265658191130704798265658191
130704798265658191
 
Introduction To Design Patterns Class 4 Composition vs Inheritance
 Introduction To Design Patterns Class 4 Composition vs Inheritance Introduction To Design Patterns Class 4 Composition vs Inheritance
Introduction To Design Patterns Class 4 Composition vs Inheritance
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
OOP History and Core Concepts
OOP History and Core ConceptsOOP History and Core Concepts
OOP History and Core Concepts
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Ios development
Ios developmentIos development
Ios development
 
Image Processing and Computer Vision in iPhone and iPad
Image Processing and Computer Vision in iPhone and iPadImage Processing and Computer Vision in iPhone and iPad
Image Processing and Computer Vision in iPhone and iPad
 
java introduction features and propertie
java introduction features and propertiejava introduction features and propertie
java introduction features and propertie
 
Block_1_Unit- I.pdf bca learning for exam you
Block_1_Unit- I.pdf  bca learning  for exam youBlock_1_Unit- I.pdf  bca learning  for exam you
Block_1_Unit- I.pdf bca learning for exam you
 
Bootstrapping iPhone Development
Bootstrapping iPhone DevelopmentBootstrapping iPhone Development
Bootstrapping iPhone Development
 

Recently uploaded

spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 

Recently uploaded (20)

spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 

Intro to iOS: Object Oriented Programming and Objective-C

  • 2. What is developing for iOS? • The language – Objective-C but most recently Swift • The tools – Xcode mostly • The concepts - MVC • The frameworks (libraries) - Cocoa touch (for iOS) is the API: Foundation and UIKit, and many others
  • 3. Intro to Object Oriented Programming What is it and why use it? A programming paradigm. Wraps up state and behavior into one package. Make “blueprints” for creating objects. Objects are abstract data types. State = instance variables. The ‘nouns’ of an object. What exactly is the object and what does it represent? Behavior = methods. The ‘verbs’ of a object. What does the object actually do?
  • 4. Why OO programming? • Modularity: Program can be broken into pieces. • Abstraction: Hide the details. • Maintenance. Don’t have to modify existing objects as long as you interface with them properly. • Reuse. Many objects do the same functionality. So why write more code? Just instantiate more instances of an object.
  • 5. What is a class? • Class is a “template” or “blueprint” that is used to create objects. • Describes the behavior and properties common to any particular type of object. • You use a class to instantiate an instance of an object.
  • 6. Object Oriented Concepts • Abstraction: Hide the details of the implementation and just deal with “what” instead of “how”. • Encapsulation : Enforces modularity. Wrapping up data members and method together into a single unit. Protect the object from other objects. • Inheritance • Polymorphism
  • 7. OO Concepts: Inheritance Objects can acquire the properties of another class. Promotes reusability of code by using existing code from parent class. Child class adopts parent class features and has its own features. Note the inheritance: All animals eat and sleep but the child classes have their own unique behaviors as well.
  • 8. OO Concepts: Polymorphism • Polymorphism: The ability of different objects to respond, each in its own way, to identical messages is called polymorphism. Note: All these shapes will draw but of course they’re implemented in different ways.
  • 9. Intro to Objective-C • Objective-C is a super set of C. • Objective-C is also known for its verbose naming conventions. • Designed to be reader friendly for humans. • Developed by NextStep. Company created by Steve Jobs after he was kicked from Apple. • Objects everywhere. • Objective-C is decidedly more dynamic, deferring most of its decisions to run-time rather than compile-time.
  • 10. Some Objective-C Data Types • Some common data types: • NSString *myString = nil; • NSString *aString = @"Hello”; • NSArray *myArray = @[object1, object2, object3]; • NSNumber *num = [[NSNumber alloc] initWithFloat:3.6]; • id = Hold a reference to any object. Notice the pointers (*) everywhere. Object instantiation galore. This has to do with Obj-C’s runtime. Obj-C is a very dynamic language. So it throws everything on the heap and just points to the objects.
  • 12. “Calling a method” vs “Sending a message” • Theoretically, they're different but in practice they’re not. Difference comes from the Objective-C runtime. • Most compiled languages refer to methods and functions internally as memory offsets where the method resides. This has the advantage of being very fast. The starting point is known at compile-time. • Objective-C runtime maintains a list of all methods and functions. This allows for dynamic behavior by allowing us to modify what section of code a method executes, not responding to a message, or introspection. • 99% of the time sending a message to an object will call the method intended. So in practice there’s not much difference.
  • 13. Basic Objective-C Header file Notice the import of Foundation. Foundation gives basic functionality for things like NSString, NSArray, NSObject, etc. It will be automatically imported to your classes when you create a new class file in Xcode. All objects will inherit from NSObject. Just do it.
  • 15. Model View Controller: An architectural pattern for organizing your code. Commonly used when implementing UI. Watch this video: http://bit.ly/Zjsic2 (Stanford University Developing iOS 7 Apps: Lecture 1)