Please note, this blog entry is from a previous course. You might want to check out the current one.
The third lecture is called “3. Objective-C (October 4, 2011)” and can be found via iTunes. Its slides are available directly at Stanford.
It starts with a review what we have learned doing the walkthrough of the last lecture and explains in more detail
- properties (especially its importance for lazy instantiation, UI updating and consistency checking),
- dot notation of properties and C structs (concerning its ease to use),
- strong vs week (using strong to keep a variable till you decide not to use it anymore and week if somebody else is the “owner” of it),
- nil (as initial value of objects, its usage in in if statements or receiving messages) and BOOL,
- instance vs class methods (dash vs plus, using instance methods to access an object, using class methods to use class functionality without addressing an individual object),
- instantiation (alloc & init, including using self & super in custom init methods),
- dynamic binding (accessing objects via pointers),
- object typing (including compiler warnings and errors when using types from inherited classes, or type casting),
- introspection (using the method class to recognize the class of an object, or check for selectors using @selector or SEL),
- the Foundation Framework (including NSObject as base class with the basic methods description, copy and mutableCopy; NSString and NSMutableString for string handling; NSNumber as wrapper for all kind of number formats; NSValue for non-object data types; NSData to hold bit collections; NSDate for date and time functionality; NSArray and NSMutableArray; NSDictionary and NSMutableDictionary as hash tables; NSSet and NSMutableSet as unordered collection of objects; NSOrderedSet and NSMutableOrderedSet as ordered collection of objects),
- enumeration (different methods to loop through collections),
- property lists (collections of collections),
- and finally NSUserDefaults as lightweight data storage of property lists.
Again, please study the slides before watching the video for maximum experience.