property strong or retain
self.view = [[UIView alloc] init];存在内存leak解决方法:
//第一种: UIView *view = [[UIView alloc] init]; //mystudent 对象 retainCount = 1; self.view = view; //student 对象 retainCount = 2; [view release]; //student 对象 retainCount = 1; //第二种: self.view = [[[UIView alloc] init]autorelease];
释放:
self.view = nil;