gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 22:56:19 24 4
gpt4 key购买 nike

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

在.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;
}

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

最佳答案

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

关于iphone - 请求成员不是结构或联合 - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10729607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com