Presentation is loading. Please wait.

Presentation is loading. Please wait.

OBJECTIVE C Kurt Ladendorf. General Knowledge  Super set of C  Smalltalk  Mainly used for iOS and other Apple development.

Similar presentations


Presentation on theme: "OBJECTIVE C Kurt Ladendorf. General Knowledge  Super set of C  Smalltalk  Mainly used for iOS and other Apple development."— Presentation transcript:

1 OBJECTIVE C Kurt Ladendorf

2 General Knowledge  Super set of C  Smalltalk  Mainly used for iOS and other Apple development

3 Data types  int, double, float, char, BOOL (YES, NO)  id  long, long long, short  Signed/unsigned  Nil

4 Control structures  If  Switch  For  Do while  Try catch finally

5 Methods  Method template:  -(void) setScore : (int) score andTime : (int) time;  Method call  [objectName setScore: 12 andTime: 47];

6 Arrays  Immutable  Derived from NSArray  Mutable  Derived from NSMutableArray

7 Array Example

8 Classes  Base classes normally are children of NSObject  Instance methods  Denoted by a -  Class methods  Denoted by a +  @interface  @implementation  @public, @private, @protected

9 Inheritance  Single inheritance  Overriding a function  Use same function prototype and return type  @interface ChildClass : ParentClass

10 Instantiating Objects  Create a pointer and then call the object’s allocate and initialize methods  ClassName *foo = [[ClassName alloc] init];

11 Categories  Used to customize a class  Naming conflicts can arise!  Cannot add instance variables  Declaring a category  @interface ClassName (CategoryName)  Has an @implementation section

12 Point.h Point.m

13 Links!  http://www.techotopia.com/index.php/Objective- C_2.0_Essentials http://www.techotopia.com/index.php/Objective- C_2.0_Essentials  http://www.youtube.com/watch?v=Cfdon6Ocl_k http://www.youtube.com/watch?v=Cfdon6Ocl_k  http://gnustep.org/ http://gnustep.org/  https://developer.apple.com/ https://developer.apple.com/


Download ppt "OBJECTIVE C Kurt Ladendorf. General Knowledge  Super set of C  Smalltalk  Mainly used for iOS and other Apple development."

Similar presentations


Ads by Google