最近开始学习Objective-C,对成员变量和属性感到困惑。我想知道以下三个代码块有什么区别:
1.
@interface Application
{
UserInfo* userInfo;
ApplicationInfo*applicationInfo;
}
@property (retain) UserInfo*userInfo; // @synthesize userInfo;
@property (retain) ApplicationInfo* applicationInfo ; // @synthesize applicationInfo;
@end
2.
@interface Application
{
}
@property (retain) UserInfo*userInfo; // @synthesize userInfo;
@property (retain) ApplicationInfo* applicationInfo ; // @synthesize applicationInfo;
@end
3.
@interface Application
{
UserInfo* userInfo;
ApplicationInfo*applicationInfo;
}
@end
非常感谢你!