Embed presentation
Download to read offline



![Class Methods (+)
Called: [UIView
areAnimationsEnabled];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-4-320.jpg)

![Instance Methods (-)
Called: [[UIView alloc]
initWithFrame:frame];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-6-320.jpg)

![Java
Objective-C
Declaration:
Declaration:
void myMethod(void) {...}
-(void)myMethod {...}
To call:
To call:
myMethod();
[self myMethod];
Declaration:
Declaration:
void myMethod (int x) {...}
-(void)myMethod:(int)x {...}
To call:
To call:
myMethod(4);
[self myMethod:4];
Declaration:
void sqrt (int base, int exp{...}
To call:
sqrt(4,5);
Declaration:
-(void)sqrt:(int)base expNumber:(int)exp {...}
To call:
[self sqrt:4 exp:5];
Declaration:
Declaration:
int sqrt (int base, int exp) {
return ...; }
-(int) sqrt:(int)base expNumber:(int)exp {
return ...; }
To call:
To call:
int z = sqrt(4,5);
int z = [self base:4 expNumber:5];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-8-320.jpg)




This document introduces iOS class and instance methods in Objective-C. It compares method declaration and calling syntax between Java and Objective-C. Class methods do not require an initialized object and are called with '+'. Instance methods require an initialized object and are called with '-'. The document also mentions controller objects and the view lifecycle in iOS.



![Class Methods (+)
Called: [UIView
areAnimationsEnabled];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-4-320.jpg)

![Instance Methods (-)
Called: [[UIView alloc]
initWithFrame:frame];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-6-320.jpg)

![Java
Objective-C
Declaration:
Declaration:
void myMethod(void) {...}
-(void)myMethod {...}
To call:
To call:
myMethod();
[self myMethod];
Declaration:
Declaration:
void myMethod (int x) {...}
-(void)myMethod:(int)x {...}
To call:
To call:
myMethod(4);
[self myMethod:4];
Declaration:
void sqrt (int base, int exp{...}
To call:
sqrt(4,5);
Declaration:
-(void)sqrt:(int)base expNumber:(int)exp {...}
To call:
[self sqrt:4 exp:5];
Declaration:
Declaration:
int sqrt (int base, int exp) {
return ...; }
-(int) sqrt:(int)base expNumber:(int)exp {
return ...; }
To call:
To call:
int z = sqrt(4,5);
int z = [self base:4 expNumber:5];](https://image.slidesharecdn.com/ltintroducetoios-140205083825-phpapp01/85/Lightning-Talk-Introduce-to-iOS-7-8-320.jpg)


