Tu Ch
Tu Ch

Reputation: 133

Request for member not a structure or union - iOS

I wanted to change the default view that loads up in MainWindows.xib. So I added a new instance variable for the class I want to add the view of here is the code in .h

 @class Table;
@interface GameUIAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
Table *viewController; //changed the class
 }
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet Table *viewController;

and then in the MainWidow.xib I changed the class name and xib on the UIView

in the .m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after application launch.

// Add the view controller's view to the window and display.
[self.window addSubview:viewController.view]; //error here 
[self.window makeKeyAndVisible];

return YES;
 }

what am I missing and please explain me why am I getting this error

Upvotes: 0

Views: 127

Answers (1)

borrrden
borrrden

Reputation: 33421

You need to #import "Table.h" in your .m file.

Upvotes: 2

Related Questions