开发者

Difference between properties and fields in iOS

开发者 https://www.devze.com 2023-03-26 10:54 出处:网络
Can somebody explain me what exactly is the difference between: @interface PersistenceViewController : UIViewController {

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

精彩评论

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