为什么下面的代码会崩溃?注释代码不会崩溃。
@property (retain) NSDate *lastCurrentDate;
...
@synthesize lastCurrentDate;
- (void)viewWillAppear:(BOOL)animated {
BOOL crash = [lastCurrentDate isEqualToDate:[NSDate date]]);
}
- (void)viewDidDisappear:(BOOL)animated {
//lastCurrentDate = [[NSDate date] retain];
lastCurrentDate = [NSDate date];
}
那么,为什么在 Objective-C 上可能无法保留属性?