代码之家  ›  专栏  ›  技术社区  ›  GibboK

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

  •  1
  • GibboK  · 技术社区  · 12 年前

    我收到这个错误

    Property implementation must have its declaration in interface "AppDelegate"
    

    当我申报

    @implementation AppDelegate
    
    @synthesize window, viewController;
    @synthesize token;
    

    我使用的是Xcode 4.4。

    2 回复  |  直到 12 年前
        1
  •  1
  •   Sergey Kalinichenko    12 年前

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

    @property (nonatomic, readwrite) NSString *token;
    

    代替 NS字符串* 您的正确类型 代币 所有物可以找到有关属性的更多信息 here

        2
  •  0
  •   ddoor    12 年前

    看起来你没有设置 寡妇 , 视图控制器 代币 作为.h文件中的属性。

    你打字了吗 @property (nonatomic, strong) NSString *token;