views:

142

answers:

3

I have spent a lot of time trying to figure out what the problem is... but with no success.

My code is the following:

ResultGoalViewController *resultGoalViewController = [[ResultGoalViewController alloc] initWithNibName:@"ResultGoalViewController" bundle:nil];

[self.goalNavigationController pushViewController:resultGoalViewController animated:YES];

I get the error: "error:Request for member 'goalNavigationController' in something not a structure or a union."

My class is UIViewController. goalNavigationController is a Navigation Controller (defined within a Tab Controller).

What am I missing?

+4  A: 

goalNavigationController should be a property or an accessor in your UIViewController subclass.

mipadi
`@property(nonatomic, retain) GoalNavigationController *goalNavigationController``@synthesize goalNavigationController`
Nick Bedford
Don't forget your semicolons!
jbrennan
+4  A: 

It sounds like self doesn't have a goalNavigationController property. If it does, you should post where it's declared so we can see that.

Chuck
A: 

Thanks Chuck, thanks Mipadi.

I have a goalNavigationController property in the delegate application.

@interface MyAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UITabBarController *mytabBarController;
NavigationGoalViewController *goalNavigationController;

}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) NavigationGoalViewController *goalNavigationController;

@end

But it's not in my current UIViewController Class, as my goalNavigationController was first built/called within my delegate application. I am now calling it from the ViewController of the first view of my Navigation (I am trying to load the second view of my navigation controller).

Cecile