Xcode Outlet生成不会生成@synthezise

dng*_*fng 3 xcode objective-c ios6

我遇到了Drag and Drop Outlet生成的问题,由于某种原因,Xcode停止生成.sy文件的@synthezise,@ property被正确添加到.h文件中.

另外,我发现奇怪的是@interface块被添加到.m文件中,即使具有@interface的.h文件也存在.

@interface BlahController {

}

@implementation BlahController : UIViewController {
    //Code
}
Run Code Online (Sandbox Code Playgroud)

Cal*_*leb 6

我遇到了Drag and Drop Outlet生成的问题,由于某种原因,XCode停止生成.sy文件的@synthezise,@ property被正确添加到.h文件中.

最新版本的编译器不再需要@synthesize指令.只是声明使用该@property指令的属性足以导致访问者被合成,除非您使用该@dynamic指令或为该属性提供您自己的访问者.


dng*_*fng 5

在高级感谢Carl Veazey,他在评论中写了这个答案:

  1. 该接口用于私有变量.
  2. 必须通过_variableName访问"缺少的"@property.

非常感谢再次.