Objective C: Presented By: S.Upendhar 07891A0565
Objective C: Presented By: S.Upendhar 07891A0565
Objective C: Presented By: S.Upendhar 07891A0565
Presented By :
S.Upendhar
07891A0565
CONTENTS :
1. Introduction
2. History
3. Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9. Objective C vs. C++
10.“Objective C”
11.Conclusion
CONTENTS :
1.Introduction
2. History
3. Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9. Objective C vs. C++
10.“Objective C”
INTRODUCTION
Objective-C is implemented as set of
extensions to the C language.
It's designed to give C a full capability for
object-oriented programming, and to do so
in a simple and straightforward way.
Its additions to C are few and are mostly
based on Smalltalk, one of the first
object-oriented programming languages.
CONTENTS :
1. Introduction
2.History
3. Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9. Objective C vs. C++
10.“Objective C”
HISTORY
Objective-C was invented by two men, Brad Cox and
TomInventors
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.
HISTORY (Cont.)
Includes a root class NSObject where words like alloc, retain, and
release come from
CONTENTS :
1. Introduction
2. History
3.Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9. Objective C vs. C++
10.“Objective C”
WHY OBJECTIVE C ?
Objective-C incorporates C, you get all the benefits of C
when working within Objective-C.
You can choose when to do something in an object-
oriented way (define a new class, for example) and when
to stick to procedural programming techniques (define a
structure and some functions instead of a class).
Objective-C is a simple language. Its syntax is small,
unambiguous, and easy to learn
Objective-C is the most dynamic of the object-oriented
languages based on C. Most decisions are made at run
time
WHY OBJECTIVE C ? (Cont.)
[receiver message]
The receiver is an object. The message is simply the name of a
method and any arguments that are passed to it
MESSAGES (Cont.)
method declarations
@end
INTERFACE & IMPLEMENTATION
Instance Variables:
Declaration
float width;
BOOL filled;
Methods:
o names of methods that can be used by class objects, class methods, are preceded by a
plus sign
o methods that instances of a class can use, instance methods, are marked with a minus
sign
INTERFACE & IMPLEMENTATION
Importing the Interface: The interface is usually included with
the #import directive
#import "Rectangle.h"
To reflect the fact that a class definition builds on the definitions of inherited
classes, an interface file begins by importing the interface for its superclass
Referring to Other Classes: If the interface mentions classes not in this
hierarchy, it must declare them with the @class directive:
@class Rectangle, Circle;
INTERFACE & IMPLEMENTATION
#import "ClassName.h"
The Implementation
@implementation ClassName
method definitions
@end
CONTENTS :
1. Introduction
2. History
3. Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9.Objective C vs. C++
10.“Objective C”
OBJECTIVE c vs. C++
Adds OOP, metaprogramming and Has numerous uses
generic programming to C
Large and complex code for OOP
Only adds OOP to C
Comes with a std library
In October 2007, Apple Inc. releases Objective-C 2.0 for Mac OS 10.5
(Leopard)
CONTENTS :
1. Introduction
2. History
3. Why Objective C ?
4. ID
5. Dynamic Typing
6. Messages
7. Polymorphism and Inheritance
8. Interfaces and Implementation
9. Objective C vs. C++
10.“Objective C”
CONCLUSION
“Although the differences can fade into shades of grey, Objective-C is different
from C++. C++ is traditionally associated with the Simula 67 school of object-
oriented programming where Objective-C has SmallTalk roots. In C++, the static
type of an object determines whether it can receive a message. In Objective-C
the dynamic type of an object determines whether it can receive a message. The
Simula 67 format is more structured and allows problems to be detected earlier
when a program is compiled. The Smalltalk approach delays it's typing until
runtime and is touted as a more flexible alternative.”
“This flexibility extends the language into three separate areas: Dynamic Typing,
Dynamic Binding and Dynamic Loading.”
REFERENCES
http://www.wikipedia.org
http://developer.apple.com
http://www.mactech.com
http://www.cs.indiana.edu
http://www.kmittv.com
Any Queries…?
Thank you…!