什么时候发布房产?

Rap*_*eta 0 iphone objective-c ios4

我在头文件中声明了几个属性,只是想知道它们何时必须被释放.我目前在我的"dealloc"方法中执行它们,但在执行此操作时收到EXC_BAD_ACCESS错误.

这是我的代码

@property (nonatomic, retain) NSTimer *timer;
@property (nonatomic, retain) NSString *closeimage;
@property (nonatomic, retain) NSString *alertStyle;
@property (nonatomic, retain) NSString *phonelaunch;
@property (nonatomic, retain) NSString *resultmessage;
Run Code Online (Sandbox Code Playgroud)

这是我的dealloc方法

- (void)dealloc {
    [super dealloc];
    [timer release];
    [closeimage release];
    [alertStyle release];
    [phonelaunch release];
    [resultmessage release];
}
Run Code Online (Sandbox Code Playgroud)

在此先感谢您的帮助!

NSR*_*der 8

将您的[super dealloc]消息放在dealloc方法的末尾.