ios - Memory management in Xcode -


i try allocate , release mutable array in xcode

nsmutablearray *inventory = [[nsmutablearray alloc] init];

[inventory addobject:@"one"];

[inventory release];

does me explain why after "inventory" released, still store 1 objects?

assuming working without automatic reference counting (arc):

when release object, marks memory object occupying free. however, not destroy in memory.

if try (improperly) access @ array's memory address, may find array members still there. warned, not safe, , array , members can (and will) overwritten @ time.

you should use arc production code avoid dangers of memory mismanagement. works well.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -