属性实现必须在“AppDelegate”接口中声明

时间:2012-08-24 13:13:02

标签: xcode xcode4 xcodebuild

我收到此错误

Property implementation must have its declaration in interface "AppDelegate"

当我宣布

@implementation AppDelegate

@synthesize window, viewController;
@synthesize token;

我正在使用Xcode 4.4。

2 个答案:

答案 0 :(得分:1)

这意味着您需要转到AppDelegate.h文件,并为token添加声明。我们说它是NSString*;那么你应该将以下行添加到你的.h文件中:

@property (nonatomic, readwrite) NSString *token;

NSString*替换token属性的正确类型。有关属性的更多信息可以在here找到。

答案 1 :(得分:0)

您好像没有将寡妇 viewController 令牌设置为.h文件中的属性。

您输入了@property (nonatomic, strong) NSString *token;

吗?
相关问题