210 likes | 324 Views
Copy from WWDC 2010 session 113. Objective-C Primary . 邓宇光 iPhone Team. Introduction. Common Concepts Uncommon ideas Categories Selectors Memory Management Retain, Release, Autorelease. Common Concepts. Selectors. Selectors are data structures that represent a method “ slot”name.
E N D
Copy from WWDC 2010 session 113 Objective-C Primary 邓宇光 iPhone Team
Introduction • Common Concepts • Uncommon ideas • Categories • Selectors • Memory Management • Retain, Release, Autorelease
Selectors • Selectors are data structures that represent a method “slot”name
Memory Management • Using just the right amount of memory and no more • Memory Management starts at the design phase • Object owenership is designed an Directed Acyclic Graph • Ownership arises from simple pattern • Only +alloc, -initXXX, -retain, -copy, +newXXX
Simple Rules • Instance variables are always either • Retained • Not retained • Downlinks are retained • Uplinks are not retained
FutherReading • http://developer.apple.com/videos/wwdc • Blogs • http://www.mikeash.com/pyblog • http://www.cnblogs.com/studentdeng