iphone - How to releas the memory allocated in for appDelegate shared instace -


in app have created appdelegate shared instance , allocating memory array

appdelegate = (appdelegate_shared *)[[uiapplication sharedapplication] delegate]; appdelegate.allserviceapplist_array = [[nsmutablearray alloc]init]; appdelegate.blockxmldata_array = [[nsmutablearray alloc]init]; appdelegate.notesxmldata_array = [[nsmutablearray alloc]init];  

now not getting how release arrays have allocated. it's showing potential leaks alloc , init memory.

what correct way release these objects.

thanks in advance

if appdelegate properties defined (retain), do

appdelegate.something = [[[something alloc]init]autorelease]; 

this common pattern in objc.

retained properties retain new object, autorelease releases object in future, end result object retain count of 1 released in dealloc method.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -