objective-c 关于self的用法总结

何时self.student = [[Student alloc] init]; //student 对象 retainCount = 2;容易造成内存泄露

由于objective-c内存管理是根据引用计数处理的,当一个对象的引用计数为零时,gcc才会释放该内存。