My Blog List

Friday, June 3, 2011

Reading Notes: ViewController Initialized in this method

p 168 Goldstein says that the view controller is intialized with the applicationDidFinishLaunchingWithOptions method

That would seem to indicate the bold part below

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {   
   
      [self.window addSubview:viewController.view];
    [self.window makeKeyAndVisible];

    return YES;
}

...

Interpreting this...


[self.window addSubview:viewController.view];




the window object is receiving the message to addSubview. The parameter passed to the 'addSubview' method is viewController.view

For this paramter, the frameworks code, uses dot notation -  viewController is an object defined in the (DeepThoughts)AppDelegate.h generated code


The ".view" part though.....


Well.... when I look at the declartion addSubview in UIView.h, I see that there is a reference to something called 'view'


- (void)addSubview:(UIView *)view;


[self.window addSubview:viewController.view];

.... I don't understand this use of dot notation
.... Will need to return to this
 


 
 

No comments:

Post a Comment