【问题标题】:Property implementation must have its declaration in interface 'AppDelegate'属性实现必须在接口“AppDelegate”中声明
【发布时间】:2012-08-20 01:25:54
【问题描述】:

我收到此错误

Property implementation must have its declaration in interface "AppDelegate"

当我声明时

@implementation AppDelegate

@synthesize window, viewController;
@synthesize token;

我使用的是 Xcode 4.4。

【问题讨论】:

    标签: xcode xcode4 xcodebuild


    【解决方案1】:

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

    @property (nonatomic, readwrite) NSString *token;
    

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

    【讨论】:

    • 令牌它是推送通知的令牌,你能建议我正确的类型吗?非常感谢
    • 我认为是 NSData*,但我不是 100% 确定这一点。
    • 非常感谢我用它作为属性 @property (retain, nonatomic) NSString* token;
    【解决方案2】:

    您似乎没有在 .h 文件中将 widowviewControllertoken 设置为属性。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-08
      • 2012-02-01
      • 2012-01-23
      • 1970-01-01
      • 1970-01-01
      • 2020-01-16
      相关资源
      最近更新 更多