Monday, December 30, 2013

Consult an object-c memory management problems

How object-c in int char, NSInteger and other memory is managed? ? ? Please expert guidance, thank you brother in this
Reply:
int, char is a type C, usually on the stack, without self-management, a function call finished, when the stack restored automatically processed.
NSInteger seems to be define, is a C-type nature.
NSNumber is NS type, need to be managed, the object key is how you create, whether the object is autorelease's.
Reply:
I think that is not your own creation (new, alloc, copy), it should be not treated, NSstring also does not require treatment reserved for use. Memory management based on the three rules should be like this.

No comments:

Post a Comment