View Controller • Important property in UIViewController @property (retain) UIView *view; a pointer to top-level UIView in the Controller’s View • View Controller have a “lifecycle” from creation to destruction- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)aBundle; initializer
View Controller• After the UIViewController is initialized, viewDidLoad is called - (void)viewDidLoad;• Just before the view appears on screen, you get notiﬁed - (void)viewWillAppear:(BOOL)animated;
View Controller • Creating a UIViewController’s UI in code (no .xib, no storyboard) • override - (void)loadView; • set self.view*Do NOT implement loadView if you use a storyboard/.xib to create theUIViewController.*Do NOT set self.view anywhere else besides in loadView.*Do NOT implement loadView without setting self.view (i.e. you must setself.view in loadView).
Segues a pointer to top-level UIView in the Controller’s View
MVC should did will target controller outlet countNotiﬁcation de data da & KVO le ta ga action te so urc es model view
General process for buildingiPhone application 1. Create a simple MVC iPhone applica5on 2. Build interfaces using Interface builder 3. Declara5ons a. Declaring instance variables b. Declaring methods 4. Make connec5ons a. SeDng a pointer b. SeDng targets and ac5ons 5. Implemen5ng methods a. Ini5al method b. Ac5on methods 6. Build and run on the simulator 7. Test applica5on on the device
Create a FB iOS Apphttps://developers.facebook.com/docs/guides/mobile/
Step1: Registering your iOS App with Facebook https://developers.facebook.com/apps/Step 2: Installing the iOS SDK git clone git://github.com/facebook/facebook-ios-sdk.git use git clone https://github.com/facebook/facebook-ios-sdk OR download it directlyStep 3: Implementing Single Sign-On (SSO) *access_token