Professional Documents
Culture Documents
Cs193P - Lecture 4: Iphone Application Development
Cs193P - Lecture 4: Iphone Application Development
Cs193P - Lecture 4: Iphone Application Development
Building an Application
Model, View, Controller
Nib Files
Controls and Target-Action
• Retain/Release
■ Increment and decrement retainCount
■ When retainCount is 0, object is deallocated
• Autorelease
■ Object is released when run loop completes
• Nib files
■ UI elements and other objects
■ Details about object relationships
p
ha
p zed ib nt en
t pp
nc tia
l i i nn re
ve v it a
Lau ni m a fo dl ee Ex
pi ad a it n
Ap Lo W Ha
@interface UIApplication
+ (UIApplication *)sharedApplication
@end
■ Orchestrates the lifecycle of an application
■ Dispatches events
■ Rarely subclassed
■ UITextField
- (void)applicationWillResignActive:(UIApplication *)application;
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application;
■ Orientation
■ System Requirements
Controller
Model View
Controller
Model View
Controller
Model View
Controller
Model View
Controller
outlets
actions
Model Object
Controller
outlets
actions
Model Object
Controller
outlets
actions
Model Object
■ Value changed
■ Editing events
■ editing began
■ editing changed
■ editing ended
Controller
Controller
Controller
Controller
Controller
Controller
-(void)decrease
- (void)adjustNumberOfSides:(id)sender
withEvent:(UIEvent *)event
{
// could inspect event object if you needed to
}
- (void)removeTarget:(id)target action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents;
@end
Controller
Model View
Controller
Model View
PolygonShape
Controller
Model View
Controller
Model View
increase
decrease
PolygonShape
increase
decrease
PolygonShape
increase
decrease
PolygonShape
increase
decrease
PolygonShape