全局变量在哪里被release最好
建议用个临时变量,alloc临时的,然后把临时变量的值赋给全局的,然后把临时的release掉, 这样,全局的,只需要在dealloc中写一个release就可以了!
- http://stackoverflow.com/questions/192721/why-shouldnt-i-use-objective-c-2-0-accessors-in-init-dealloc
-
- http://stackoverflow.com/questions/1283419/valid-use-of-accessors-in-init-and-dealloc-methods
- 分配内存就需要release,alloc