请求成员不是结构或联盟 - iOS

时间:2012-05-24 00:16:44

标签: iphone objective-c ios ios4

我想更改在MainWindows.xib中加载的默认视图。所以我为要添加视图的类添加了一个新的实例变量,这里的代码是.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;

然后在MainWidow.xib中我更改了UIView上的类名和xib

<。> <。>

- (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;
 }

我错过了什么,请解释我为什么会收到此错误

1 个答案:

答案 0 :(得分:2)

您需要在.m文件中#import "Table.h"