lecture8-malan - iOS Objective-C, Window-based...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: iOS Objective-C, Window-based Applications, MVC OSes Used Regularly 150 120 90 60 30 0 D BS nux Li OS c Ma s ari ol w do in S W XP s W ws o nd i ista V W s7 w do in Devices Used Regularly 100 75 50 25 0 A d roi nd e on ph A oid r nd t bl e ta k lac B rry Be Pad i e on iPh d Po i uch to ebO w e on ph S W s7 w do in e on ph Most Excited For... Web 12% Android 39% iOS 48% .h @interface Foo: NSObject { // instance variables } // declarations of methods @end .m @implementation Foo // definitions of methods @end Instance Variables @protected @private @public Class Methods +alloc; Instance Methods  ­ (int)age;  ­ (void)setAge:(int)age;  ­ (void)init;  ­ (void)initWithName:(NSString *)name andAge:(int)age; Messages [student age]; [student setAge:20]; [student init]; [student initWithName:@"Alice" andAge:20]; Selectors alloc age setAge: init initWithName:andAge: @property assign copy retain atomic nonatomic readonly readwrite @synthesize Memory Management alloc autorelease dealloc release retain Collections NSArray NSMutableArray NSDictionary NSMutableDictionary NSSet NSMutableSet ... Fast Enumeration for (id foo in bar) { // do something with foo } Categories @interface Foo (Bar)  ­(void)baz; @end Protocols @interface Student <NSCopying> { } ... @end Protocols @implementation Student ...  ­(id)copyWithZone:(NSZone *)zone { Student *s = [Student allocWithZone:zone]; [s initWithName:_name andAge:_age]; return s; } ... @end NSException @try { // try something here } @catch (NSException *e) { // handle exception here } @finally { // do something here } NSError NSError *e = nil; if ([foo bar:baz error:&e] == nil) { // handle error } MVC http://developer.apple.com/library/ios/documentation/iphone/conceptual/iPhone101/Articles/02_DesignPatterns.html ...
View Full Document

Ask a homework question - tutors are online