简体   繁体   English

界面生成器IBOutlet-否@synthesize

[英]Interface Builder IBOutlet - no @synthesize

I'm using XCode 4.4.1 to learn iPhone dev. 我正在使用XCode 4.4.1来学习iPhone开发人员。

I'm creating outlet properties in my ABCViewController.h header by dragging from the 'Referencing Outlets' section in the pop-up menu for a UIObject. 通过在UIObject弹出菜单的“参考出口”部分中拖动,在ABCViewController.h标头中创建出口属性。 This adds lines such as: 这将添加以下行:

@property (strong, nonatomic) IBOutlet UITextField *nameField;

to the header file. 到头文件。

Now when I view the corresponding ABCViewController.m file I'm expecting to see 现在,当我查看相应的ABCViewController.m文件时,我希望看到

@synthesize nameField; 

auto-generated somewhere. 在某处自动生成。 But it isn't - I have to add each @synthesize statement manually. 但这不是-我必须手动添加每个@synthesize语句。

It's only a minor niggle, but I'd like to know what's going wrong. 这只是个小问题,但我想知道出了什么问题。

Any ideas? 有任何想法吗?

In Xcode 4.4 (specifically, the LLVM 4.0 Compiler), synthesis of properties happens by default if there's no @synthesize directive. 在Xcode 4.4(特别是LLVM 4.0编译器)中,如果没有@synthesize指令,则默认情况下会进行属性综合。 It's equivalent to: 等效于:

@synthesize nameField = _nameField;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM