SlideShare a Scribd company logo
OBJECT ORIENTED PROGRAMMING
 Objective-C is an object oriented language.
follows ANSI C style coding with methods
 There is no formal written standard
Relies mostly on libraries written by others
 Flexible almost everything is done at runtime.
Dynamic Binding
Dynamic Typing
Dynamic Linking
INVENTORS
• Objective-C was invented by two men, Brad Cox and Tom
Love.
• Both were introduced to Smalltalk at ITT in 1981
• Cox thought something like Smalltalk would be very useful to
application developers
• Cox modified a C compiler and by 1983 he had a working
Object-oriented extension to C called OOPC.
INVENTORS
• Tom Love acquired a commercial copy of Smalltalk-80 while
working for Schlumberger Research
• With direct access Smalltalk, Love added more to OOPC
making the final product, Objective-C.
• In 1986 they release Objective-C through their company
“Stepstone”
BASIC SYNTAX STRUCTURE
C++ syntax
void function(int x, int y, charz);
Object.function(x, y, z);
Objective-C syntax
-(void) function:(int)x, (int)y,
(char)z;
[Object function:x, y, z];
Class Declaration (Interface)
#import <Cocoa/Cocoa.h>
@interface Node : NSObject
{
Node *link;
int contents;
}
+(id)new;
-
(void)setContent:(int)numbe
r;
-(void)setLink:(Node*)next;
-(int)getContent;
-(Node*)getLink;
@end
Class Definition (Implementation)
#import "node.h”
@implementation Node
+(id)new
{ return [Node alloc];}
-(void)setContent:(int)number
{contents = number;}
-(void)setLink:(Node*)next {
[link autorelease];
link = [next retain];
}
-(int)getContent
{return contents;}
-(Node*)getLink
{return link;}
@end
C++ VS. Objective-C
Adds OOP,
metaprogramming and
generic programming to C
Comes with a std library
Has numerous uses
Large and complex code
for OOP
Only adds OOP to C
Has no standard library;
is dependant on other
libraries
Mostly used for
application building
Simpler way of handling
classes and objects
Example: main.c
#import "stack.h”
int main(){
Stack *s = [Stack new];
[s push:1];
[s push:2];
printf("%dt", [s pop]);
[s push:3];
printf("%dt", [s pop]);
printf("%dt", [s pop]);
[s release];
return 0;
}
$ gcc -x objective-c node.m linkList.m stack.m main.c -
framework Cocoa -o stackTest
$./stackTest
2 3 1
we provide online and classroom training for Object oriented programming
For more details
www.asit.amcsquare.com
Wise Machines India Pvt Ltd
# 360, Sri Sai Padma Arcade,
Varthur Main Road,
Ramagondanahalli,
Whitefield ,Bangalore – 560066
9740377262
* we also have branches in Hyderabad and Chennai

More Related Content

What's hot

1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of cHarish Kumawat
 
Python and ArcGIS 10.1
Python and ArcGIS 10.1Python and ArcGIS 10.1
C language myths & secrets
C language myths & secretsC language myths & secrets
C language myths & secrets
ankush1510
 
History of c
History of cHistory of c
History of c
Shipat Bhuiya
 
ArcGIS Python Programming (3Nov11)
ArcGIS Python Programming (3Nov11)ArcGIS Python Programming (3Nov11)
ArcGIS Python Programming (3Nov11)
WV Assocation of Geospatial Professionals
 
Introduction to c language | History of C language
Introduction to c language | History of C languageIntroduction to c language | History of C language
Introduction to c language | History of C language
simplidigital
 

What's hot (6)

1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
 
Python and ArcGIS 10.1
Python and ArcGIS 10.1Python and ArcGIS 10.1
Python and ArcGIS 10.1
 
C language myths & secrets
C language myths & secretsC language myths & secrets
C language myths & secrets
 
History of c
History of cHistory of c
History of c
 
ArcGIS Python Programming (3Nov11)
ArcGIS Python Programming (3Nov11)ArcGIS Python Programming (3Nov11)
ArcGIS Python Programming (3Nov11)
 
Introduction to c language | History of C language
Introduction to c language | History of C languageIntroduction to c language | History of C language
Introduction to c language | History of C language
 

Similar to Learn OOP'S at ASIT

C som-programmeringssprog-bt
C som-programmeringssprog-btC som-programmeringssprog-bt
C som-programmeringssprog-bt
InfinIT - Innovationsnetværket for it
 
What is unique in Objective C?
What is unique in Objective C?What is unique in Objective C?
What is unique in Objective C?
Chetu
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
Daniela Da Cruz
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
Nijo Job
 
An Objective-C Primer
An Objective-C PrimerAn Objective-C Primer
An Objective-C PrimerBabul Mirdha
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
Asim Rais Siddiqui
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
sudipv
 
SpringPeople Introduction to iOS Apps Development
SpringPeople Introduction to iOS Apps DevelopmentSpringPeople Introduction to iOS Apps Development
SpringPeople Introduction to iOS Apps Development
SpringPeople
 
Objective c intro (1)
Objective c intro (1)Objective c intro (1)
Objective c intro (1)
David Echeverria
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
Edward Blurock
 
basics of c++
basics of c++basics of c++
basics of c++
gourav kottawar
 
basics of c++
basics of c++basics of c++
basics of c++
gourav kottawar
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
Madurai Kamaraj University Madurai Tamil Nadu India
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
Madurai Kamaraj University Madurai Tamil Nadu India
 
Evolution of programming language
Evolution of programming languageEvolution of programming language
Evolution of programming language
Sameer Saini
 
ChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChris Schilling
 
Ios development
Ios developmentIos development
Ios development
Shakil Ahmed
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
Prof. Wim Van Criekinge
 

Similar to Learn OOP'S at ASIT (20)

C som-programmeringssprog-bt
C som-programmeringssprog-btC som-programmeringssprog-bt
C som-programmeringssprog-bt
 
What is unique in Objective C?
What is unique in Objective C?What is unique in Objective C?
What is unique in Objective C?
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
 
An Objective-C Primer
An Objective-C PrimerAn Objective-C Primer
An Objective-C Primer
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
 
SpringPeople Introduction to iOS Apps Development
SpringPeople Introduction to iOS Apps DevelopmentSpringPeople Introduction to iOS Apps Development
SpringPeople Introduction to iOS Apps Development
 
Objective c intro (1)
Objective c intro (1)Objective c intro (1)
Objective c intro (1)
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
 
basics of c++
basics of c++basics of c++
basics of c++
 
basics of c++
basics of c++basics of c++
basics of c++
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
Evolution of programming language
Evolution of programming languageEvolution of programming language
Evolution of programming language
 
ChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChrisSchilling_SideProjects
ChrisSchilling_SideProjects
 
P1 2017 python
P1 2017 pythonP1 2017 python
P1 2017 python
 
Ios development
Ios developmentIos development
Ios development
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 

More from ASIT

Asit education student review
Asit education student reviewAsit education student review
Asit education student review
ASIT
 
ASIT EDUCATION STUDENT REVIEWS
ASIT EDUCATION STUDENT REVIEWSASIT EDUCATION STUDENT REVIEWS
ASIT EDUCATION STUDENT REVIEWS
ASIT
 
Asit Education
Asit EducationAsit Education
Asit Education
ASIT
 
Asit Education Student Reviews
Asit Education Student ReviewsAsit Education Student Reviews
Asit Education Student Reviews
ASIT
 
Asit education Student review
Asit education Student reviewAsit education Student review
Asit education Student review
ASIT
 
ASIT EDUCATION REVIEW
ASIT EDUCATION REVIEWASIT EDUCATION REVIEW
ASIT EDUCATION REVIEW
ASIT
 
Asit Never Cheats Unemployes
Asit Never Cheats UnemployesAsit Never Cheats Unemployes
Asit Never Cheats UnemployesASIT
 
Latest News on Amc Square Asit
Latest News on Amc Square AsitLatest News on Amc Square Asit
Latest News on Amc Square Asit
ASIT
 
Asit amc never cheats students
Asit amc never cheats studentsAsit amc never cheats students
Asit amc never cheats studentsASIT
 
News on AMC Square ASIT
News on AMC Square ASITNews on AMC Square ASIT
News on AMC Square ASIT
ASIT
 
News on Asit Amc
News on Asit AmcNews on Asit Amc
News on Asit Amc
ASIT
 
Time Management
Time ManagementTime Management
Time Management
ASIT
 
learn Ruby at ASIT
learn Ruby at ASITlearn Ruby at ASIT
learn Ruby at ASIT
ASIT
 
introduction to Mongodb
introduction to Mongodbintroduction to Mongodb
introduction to Mongodb
ASIT
 
introduction to hadoop
introduction to hadoopintroduction to hadoop
introduction to hadoop
ASIT
 
ASIT REVIEWS
ASIT REVIEWSASIT REVIEWS
ASIT REVIEWS
ASIT
 
ASIT REVIEWS
ASIT REVIEWSASIT REVIEWS
ASIT REVIEWS
ASIT
 
Learn REST API at ASIT
Learn REST API at ASITLearn REST API at ASIT
Learn REST API at ASIT
ASIT
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASIT
ASIT
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASIT
ASIT
 

More from ASIT (20)

Asit education student review
Asit education student reviewAsit education student review
Asit education student review
 
ASIT EDUCATION STUDENT REVIEWS
ASIT EDUCATION STUDENT REVIEWSASIT EDUCATION STUDENT REVIEWS
ASIT EDUCATION STUDENT REVIEWS
 
Asit Education
Asit EducationAsit Education
Asit Education
 
Asit Education Student Reviews
Asit Education Student ReviewsAsit Education Student Reviews
Asit Education Student Reviews
 
Asit education Student review
Asit education Student reviewAsit education Student review
Asit education Student review
 
ASIT EDUCATION REVIEW
ASIT EDUCATION REVIEWASIT EDUCATION REVIEW
ASIT EDUCATION REVIEW
 
Asit Never Cheats Unemployes
Asit Never Cheats UnemployesAsit Never Cheats Unemployes
Asit Never Cheats Unemployes
 
Latest News on Amc Square Asit
Latest News on Amc Square AsitLatest News on Amc Square Asit
Latest News on Amc Square Asit
 
Asit amc never cheats students
Asit amc never cheats studentsAsit amc never cheats students
Asit amc never cheats students
 
News on AMC Square ASIT
News on AMC Square ASITNews on AMC Square ASIT
News on AMC Square ASIT
 
News on Asit Amc
News on Asit AmcNews on Asit Amc
News on Asit Amc
 
Time Management
Time ManagementTime Management
Time Management
 
learn Ruby at ASIT
learn Ruby at ASITlearn Ruby at ASIT
learn Ruby at ASIT
 
introduction to Mongodb
introduction to Mongodbintroduction to Mongodb
introduction to Mongodb
 
introduction to hadoop
introduction to hadoopintroduction to hadoop
introduction to hadoop
 
ASIT REVIEWS
ASIT REVIEWSASIT REVIEWS
ASIT REVIEWS
 
ASIT REVIEWS
ASIT REVIEWSASIT REVIEWS
ASIT REVIEWS
 
Learn REST API at ASIT
Learn REST API at ASITLearn REST API at ASIT
Learn REST API at ASIT
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASIT
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASIT
 

Recently uploaded

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

Learn OOP'S at ASIT

  • 1. OBJECT ORIENTED PROGRAMMING  Objective-C is an object oriented language. follows ANSI C style coding with methods  There is no formal written standard Relies mostly on libraries written by others  Flexible almost everything is done at runtime. Dynamic Binding Dynamic Typing Dynamic Linking
  • 2. INVENTORS • Objective-C was invented by two men, Brad Cox and Tom Love. • Both were introduced to Smalltalk at ITT in 1981 • Cox thought something like Smalltalk would be very useful to application developers • Cox modified a C compiler and by 1983 he had a working Object-oriented extension to C called OOPC.
  • 3. INVENTORS • Tom Love acquired a commercial copy of Smalltalk-80 while working for Schlumberger Research • With direct access Smalltalk, Love added more to OOPC making the final product, Objective-C. • In 1986 they release Objective-C through their company “Stepstone”
  • 4. BASIC SYNTAX STRUCTURE C++ syntax void function(int x, int y, charz); Object.function(x, y, z); Objective-C syntax -(void) function:(int)x, (int)y, (char)z; [Object function:x, y, z];
  • 5. Class Declaration (Interface) #import <Cocoa/Cocoa.h> @interface Node : NSObject { Node *link; int contents; } +(id)new; - (void)setContent:(int)numbe r; -(void)setLink:(Node*)next; -(int)getContent; -(Node*)getLink; @end
  • 6. Class Definition (Implementation) #import "node.h” @implementation Node +(id)new { return [Node alloc];} -(void)setContent:(int)number {contents = number;} -(void)setLink:(Node*)next { [link autorelease]; link = [next retain]; } -(int)getContent {return contents;} -(Node*)getLink {return link;} @end
  • 7. C++ VS. Objective-C Adds OOP, metaprogramming and generic programming to C Comes with a std library Has numerous uses Large and complex code for OOP Only adds OOP to C Has no standard library; is dependant on other libraries Mostly used for application building Simpler way of handling classes and objects
  • 8. Example: main.c #import "stack.h” int main(){ Stack *s = [Stack new]; [s push:1]; [s push:2]; printf("%dt", [s pop]); [s push:3]; printf("%dt", [s pop]); printf("%dt", [s pop]); [s release]; return 0; } $ gcc -x objective-c node.m linkList.m stack.m main.c - framework Cocoa -o stackTest $./stackTest 2 3 1
  • 9. we provide online and classroom training for Object oriented programming For more details www.asit.amcsquare.com Wise Machines India Pvt Ltd # 360, Sri Sai Padma Arcade, Varthur Main Road, Ramagondanahalli, Whitefield ,Bangalore – 560066 9740377262 * we also have branches in Hyderabad and Chennai