这节课:
@interface MyClass
{
Something* pointer;
}
@property (nonatomic, retain) Something* pointer;
@end
@implementation MyClass
@synthesize pointer
@end
显然运行相同:
@interface MyClass
@property (nonatomic, retain) Something* pointer;
@end
@implementation MyClass
@synthesize pointer
@end
创建综合属性时,是否还需要在其类接口中指向它的指针?我注意到无论我是否有指针,我的程序显然运行相同。声明指针是否更好?