开发者

Difference between properties and fields in iOS

Can somebody explain me what exactly is the difference between:

@interface PersistenceViewController : UIViewController { 
    UITextField *field1; 
    UITextField *field2; 
    UITextField *field3;
} 

@property (nonatomic, retain) IBOutlet UITextField *field1; 
@property (nonatomic, retain) IBOutlet UITextField *field2; 
@property (nonatomic, retain) IBOutlet UITextField *field3; 

and

@interface PersistenceViewController : UIViewController { 
} 
@property (nonatomic, retain) IBOutlet UITextField *field1; 
@property (nonatomic, retain) IBOutlet UIT开发者_运维百科extField *field2; 
@property (nonatomic, retain) IBOutlet UITextField *field3; 

They both seem to work the same way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜