Will Jenkins
Will Jenkins

Reputation: 9907

Interface Builder IBOutlet - no @synthesize

I'm using XCode 4.4.1 to learn iPhone dev.

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. 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

@synthesize nameField; 

auto-generated somewhere. But it isn't - I have to add each @synthesize statement manually.

It's only a minor niggle, but I'd like to know what's going wrong.

Any ideas?

Upvotes: 0

Views: 549

Answers (1)

Phillip Mills
Phillip Mills

Reputation: 31026

In Xcode 4.4 (specifically, the LLVM 4.0 Compiler), synthesis of properties happens by default if there's no @synthesize directive. It's equivalent to:

@synthesize nameField = _nameField;

Upvotes: 5

Related Questions