Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

luckylefty01

macrumors member
Original poster
I've got something that kind of stumps me.

In my iPhone app delegate I have this code, which works (accessing the view property of the UIViewController MainViewController):

Code:
MainViewController *mainViewController =
    (MainViewController*)rootViewController.mainViewController;
MainView *mainView = (MainView *)[mainViewController view];


What I originally wanted to do was:

Code:
MainView *mainView = rootViewController.mainViewController.view;
which fails with an "error: accessing unknown 'view' component of a property."

Can anybody enlighten me as to why?
 
I've got something that kind of stumps me.

In my iPhone app delegate I have this code, which works (accessing the view property of the UIViewController MainViewController):

Code:
MainViewController *mainViewController =
    (MainViewController*)rootViewController.mainViewController;
MainView *mainView = (MainView *)[mainViewController view];


What I originally wanted to do was:

Code:
MainView *mainView = rootViewController.mainViewController.view;
which fails with an "error: accessing unknown 'view' component of a property."

Can anybody enlighten me as to why?

Have you tried:
Code:
MainView *mainView = [rootViewController.mainViewController view];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.