Been through a lot of googling...but couldn't find the exact answer....
I know the basic idea that....whatever you alloc/copy/retain you must release it....allright.....it all works fine if i go by this approach.....
But when i create objects with convenience methods...like....
NsNumber *number=[NsNumber numberwithint...];
the problem starts here....
Since (number) is not created by me...i am not the owner....so i don't release it...i believe when my work is done...it will get autoreleased.....
I do not create any autorelease objects(pools) myself....
so i believe this (number) will get added to main() function's AutoRelease pool.....
But when does main() funtion's autorelease pool get drained....
Did a bit of thing here and there...Debugged main() function....found out that control never goes past that [pool alloc] statement......
From articles found out that....on End of every event loop autorelease pool dealloc's objects....
I am really confused....
--> When does main function's autorelease pool really gets popped up?
--> what does end of event loop really mean?
Went through instruments...saw net allocation....due to these objects my memory really shoots up.....
amal
I know the basic idea that....whatever you alloc/copy/retain you must release it....allright.....it all works fine if i go by this approach.....
But when i create objects with convenience methods...like....
NsNumber *number=[NsNumber numberwithint...];
the problem starts here....
Since (number) is not created by me...i am not the owner....so i don't release it...i believe when my work is done...it will get autoreleased.....
I do not create any autorelease objects(pools) myself....
so i believe this (number) will get added to main() function's AutoRelease pool.....
But when does main() funtion's autorelease pool get drained....
Did a bit of thing here and there...Debugged main() function....found out that control never goes past that [pool alloc] statement......
From articles found out that....on End of every event loop autorelease pool dealloc's objects....
I am really confused....
--> When does main function's autorelease pool really gets popped up?
--> what does end of event loop really mean?
Went through instruments...saw net allocation....due to these objects my memory really shoots up.....
amal