I have a set of UIViewControllers that I am accumulating with the NavigationController. When I get to the last element of this heap, I do popToRootViewController. If I try to create this heap again (and yes, I use some memory load in my views), the system calls Warning and viewDidUnload memory for one of my previous objects in the heap of the navigation controller. I know that this is normal, I can not control when it will generate warnings about memory or call viewDidUnload. The problem is that for some reason, when it becomes "I" there, it is already unallocated (NSZombie), so I can not set my properties to nil and free up memory. If I do this, I will receive a message sent to the freed instance.
Two things:
(a) Is there a way to get me to free all sub items from the navigation controller when I go to root, so I can be more “memory friendly”?
(b) Why would he call viewDidUnload of an unallocated class?
Here is the stack trace I get:
#0 0x33a69910 in ___forwarding___ ()
#1 0x33a69860 in __forwarding_prep_0___ ()
#2 0x0000e4a2 in -[MyViewController viewDidUnload] at /Users/Fernando/src/Classes/MyViewController.m:866
#3 0x32105484 in -[UIViewController unloadViewForced:] ()
#4 0x321053d0 in -[UIViewController unloadViewIfReloadable] ()
#5 0x3219ede4 in -[UIViewController purgeMemoryForReason:] ()
#6 0x3219ee04 in -[UIViewController didReceiveMemoryWarning] ()
#7 0x0000e426 in -[MyViewController didReceiveMemoryWarning] ()
#8 0x3219ee1a in -[UIViewController _didReceiveMemoryWarning:] ()
#9 0x3362d622 in _nsnote_callback ()
#10 0x33a47122 in __CFXNotificationPost_old ()
#11 0x33a46dc2 in _CFXNotificationPostNotification ()
#12 0x3361cd22 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#13 0x33626240 in -[NSNotificationCenter postNotificationName:object:] ()
#14 0x32167da8 in -[UIApplication _performMemoryWarning] ()
#15 0x321689ca in -[UIApplication _receivedMemoryNotification] ()
#16 0x32165776 in _memoryStatusChanged ()
#17 0x33a770cc in __CFNotificationCenterDarwinCallBack ()
#18 0x33a5dbe6 in __CFMachPortPerform ()
#19 0x33a556fe in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#20 0x33a556c2 in __CFRunLoopDoSource1 ()
#21 0x33a47f7c in __CFRunLoopRun ()
#22 0x33a47c86 in CFRunLoopRunSpecific ()
#23 0x33a47b8e in CFRunLoopRunInMode ()
#24 0x33b0e4aa in GSEventRunModal ()
#25 0x33b0e556 in GSEventRun ()
#26 0x32099328 in -[UIApplication _run] ()
#27 0x32096e92 in UIApplicationMain ()
#28 0x00002c72 in main at /Users/Fernando/src/main.m:13
Any help / suggestion really appreciated!
Thank,
Fernando
source
share