http://www.mikeash.com/pyblog/friday-qa-2010-01-15-stack-and-heap-objects-in-objective-c.html
NSObject *obj = [[NSObject alloc] init];
obj
variable itself is on the stack, but the object it points to is in the heap. The
[NSObject alloc]
call allocates a chunk of heap memory, and fills it out to match the layout needed for an
NSObject
.
众里寻你千百度啊,可以我是我谷歌找到你的。要的就是这句话。