Верны ли мои два предположения о свойствах?
@interface Foo : NSObject {
NSDate *Created;
}
@property (nonatomic, retain) NSDate *Created;
@end
@implementation Foo
@synthesize Created;
- (id) init {
if(self = [super init])
{
Created = [NSDate date]; //this will not call the setter and instead just access the variable directly, which means it will not automatically get retained for me.
self.Created = [NSDate date]; // this will call the setter, which will retain the variable automatically for me.
}
return self;
}
- (void)dealloc {
[Created release]
[super dealloc];
}
@end