iphone--release相关

 全局变量在哪里被release最好

建议用个临时变量,alloc临时的,然后把临时变量的值赋给全局的,然后把临时的release掉, 这样,全局的,只需要在dealloc中写一个release就可以了!

  1. http://stackoverflow.com/questions/192721/why-shouldnt-i-use-objective-c-2-0-accessors-in-init-dealloc  
  2.  
  3. http://stackoverflow.com/questions/1283419/valid-use-of-accessors-in-init-and-dealloc-methods 
  4. 分配内存就需要release,alloc

你可能感兴趣的:(iphone--release相关)