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

luckylefty01

macrumors member
Original poster
Apr 8, 2008
32
0
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?
 

tacoman667

macrumors regular
Mar 27, 2008
143
0
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];
 

luckylefty01

macrumors member
Original poster
Apr 8, 2008
32
0
Is your mainViewController property declared as being a MainViewController* ?

*sigh*

Thanks. In my app delegate I had imported the root view controller and the main view itself, but the main view controller had been left out.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.