Home      Labs      Publications      People      Tools   

From CAGT

CS211 iPhone Programming Course Wiki - Lectures

Information From Lectures

Contents


Week of May 18-20

Starting with Xcode and Interface Builder

Covered:

  • Using Xcode SDK, Interface Builder, and the iPhone simulator
  • Using the documentation by "option double click" on a key word
  • @interface file (.h)
  • @implementation file (.m)
  • Objective-C syntax
  • Object Class definitions
  • Subclassing and inheritance
  • Instance variables (@property, @synthesize, release)
  • Class methods and Instance methods
  • Messages and Receivers
  • "nib" files (.xib)
  • Interface Builder (the View, the Library, the Inspector, File's Owner)
  • IBOutlets (Control Drag from File's Owner to the object)
  • IBActions (Drag from Library connections to File's Owner)
  • Implementation of a "-(IBAction)buttonPressed:(id)sender" method
  • Using the documentation to find the properties (instance variables) "enabled" and "highlighted" inherited by UIButton
  • First example of how objects communicate by complying with protocols
  • The UIPickerView protocols "<UIPickerViewDelegate, UIPickerViewDataSource>" and the associated required methods
  • string notation @"A string is in quotes following an @ symbol"
  • #define to declare a constant
  • NSArray initialization methods
  • a switch statement


Week of May 25-27

  • using NSDate and NSInterval for the stopwatch
  • TabBarController application
  • adding Timer and Stopwatch to the tabbar
  • setting the UIViewController class and .xib for the tabbar
  • MultiViews
  • View Hierarchy
  • the superview property of a view (a UIView)
  • the subviews property of a view (an NSArray of UIViews)
  • [view addSubview: atIndex:]
  • [subview removeFromSuperview]
  • view index and visibility of overlapping views
  • every view has a uiviewcontroller
  • Animation example switching views

Week of June 1-3

  • who is self
  • Getters and Setters
  • @property and "dot" notation
  • @synthesize and automatic creation of getters and setters
  • NSLOG() and reporting debug information to the log
  • memory management
  • retain, release, autorelease, dealloc
  • retainCount set to 1 on alloc, new, copy
  • retainCount increases by 1 with retain
  • retainCount decreases by 1 with release
  • retainCount decreases by 1 "later" with autorelease
  • @property(retain) requies a retain to be sent in the setter function for the instance variable
  • setter and getter for @property(retain)
  • correct and incorrect ways to do assign to an instance variable when using alloc, new, copy
  • correct and incorrect ways to do assign to an instance variable when using an autorelease method
  • avoiding cyclic retain
  • why to use "self." when assigning to an instance variable
  • implementing a singleton class

Week of June 8-10

  • Guest lecture by Adam Duston and Colin Wirth. Topics: Open GL ES and iPhone entrepreneurship
  • nsdictionary
  • creating a property list with the property list editor
  • tableviews
  • indexed and plain tableviews
  • tableview data source and tableview delegate methods
  • navigation controllers
  • the navigation controller stack and pushing onto the stack
  • implementing a simple navigation controller and tableview application

Week of June 15-18

  • How objects communicate: by assigning a delegate in a method
  • Using NSURLConnection
  • declare the instance variable receivedData
  • use 'assign' in the @property
  • creating the NSURLRequest
  • creating the NSURLConnection
  • NSURLConnection delegate methods
  • connection: didReceiveResponse (setLength of data to zero)
  • connection: didReceiveData (appendData)
  • connection: didFailWithError (release connection and receivedData, notify user)
  • connectionDidFinishLoading (convert data to a string and then to a dictionary and store so accessible)
  • using a UIActivityIndicator
  • using notifications and the notification center
  • saving data as a plist file to the documents directory
  • the object types that can be stored in a plist
    • NSArray
    • NSMutableArray
    • NSDictionary
    • NSMutableDictionary
    • NSData
    • NSMutableData
    • NSString
    • NSMutableString
    • NSDate
    • NSNumber (can hold signed or unsigned char, short int, int, long int, long long int, float, double, or BOOL)
  • saving data with an archiver
  • conforming to the NSCoding protocol
    • encodeWithCoder:
    • initWithCoder:
  • using an NSArchiver to archive and unarchive an object

Week of June 22-24

  • categories
  • UIWebView
    • loading the web page with an NSURLRequest
    • implementing UIWebViewDelegate methods to find out if there is browsing history
      • the canGoBack and canGoForward properties
    • adding back and forward button functionality for the browsing history
      • the goBack and goForward methods
    • adding an activity indicator
    • connecting the delegate outlet in a .xib file
  • MKMapView
    • importing the MapKit Framework
    • setting the center and span of the map
    • creating annotations
    • MKAnnotations protocol
    • the readonly @property parameter
    • writing an init function
    • MKMapViewDelegate protocol
    • implementing the mapView: viewForAnnotation: delegate method to return an MKAnnotationView
    • using a queue for the MKAnnotationView

Things left out

  • fast enumeration
  • declaring protocols
  • @selector
Protein Engineering