以下示例说明了如何为 Person 类实现 dealloc 方法:
@interface Person : NSObject
@property (retain) NSString *firstName;
@property (retain) NSString *lastName;
@property (assign, readonly) NSString *fullName;
@end
@implementation Person
// ...
- (void)dealloc
[_firstName release];
[_lastName release];
[super dealloc];
}
@end
以上来自Apple文档: 内存管理示例
我的问题是为什么在 dealloc 中 firstName 和 lastName 之前有下划线?