它在模拟器中运行时没关系.但是当我在我的ipad中运行它时,我得到了这个信号 - "SIGUSR1"我调试了这个程序,我确信它已经用完了UIView类中的viewDidLoad方法.有人知道导致这个问题的一些常见原因吗?
我将变量设置为IBOutlet.并@property(retain) @synthesize在我的.h和.m文件中使用.像这样:
@interface testViewController {
NSArray *keys;
}
@property (nonatomic, retain) NSArray *keys;
@end
@implementation SectionViewController
@synthesize keys;
Run Code Online (Sandbox Code Playgroud)
在许多书中,他们在viewDidUnload方法中将该对象设置为nil ,并使用release方法在dealloc方法中释放该对象.像这样:
- (void)viewDidUnload {
self.keys = nil;
}
- (void)dealloc {
[super dealloc];
[keys release];
}
Run Code Online (Sandbox Code Playgroud)
据我所知,如果我使用self.keys =零,结果是一样[keys release]的dealloc方法;对象键将是release,和"无"将不被保留.
为什么有些书每次都使用这种形式?
谢谢