This is the issue:
From my main "UITableViewController" I want to show two different views. One is another "UITableViewController" and the other view is a "UIViewController".
From the main "UITableViewController" when I call the "UIViewController" I do:
Now When I do this, when the "UIViewController" returns to "UITableViewController" the app crashes with:
When the main "UITableViewController" calls the secondary "UITableViewController" like this:
This does not crash!
So, why is it ok to release when I call a "UITableViewController" and not ok when I call a "UIViewController".
And this behavior is the same if the main controller is also a "UIViewController".
Thanks in advance.
From my main "UITableViewController" I want to show two different views. One is another "UITableViewController" and the other view is a "UIViewController".
From the main "UITableViewController" when I call the "UIViewController" I do:
Code:
UIViewController *sortController = [[SortMain alloc] init];
[[self navigationController] pushViewController:sortController
animated:YES];
[myViewController release];
Now When I do this, when the "UIViewController" returns to "UITableViewController" the app crashes with:
Code:
Program received signal: EXC_BAD_ACCESS.
(gdb) bt
#0 0x916b9edb in objc_msgSend ()
#1 0x03908f40 in ?? ()
#2 0x035d4187 in CALayerUpdateSublayers ()
#3 0x035d26d1 in -[CALayer dealloc] ()
#4 0x035c4526 in CALayerRelease ()
#5 0x035cd305 in CALayerFreeTransaction ()
#6 0x035c55d0 in CA::Transaction::commit ()
#7 0x035cd838 in CA::Transaction::observer_callback ()
#8 0x01e34252 in __CFRunLoopDoObservers ()
#9 0x01e3365f in CFRunLoopRunSpecific ()
#10 0x01e32c48 in CFRunLoopRunInMode ()
#11 0x025c978d in GSEventRunModal ()
#12 0x025c9852 in GSEventRun ()
#13 0x00331003 in UIApplicationMain ()
#14 0x00002923 in main (argc=1, argv=0xbffff014) at /opt/mycode/iPhone/myapp/Classes/main.m:28
When the main "UITableViewController" calls the secondary "UITableViewController" like this:
Code:
UIViewController *detailsController = [[DetailsMain alloc] init];
[[self navigationController] pushViewController:detailsController
animated:YES];
[myViewController release];
This does not crash!
So, why is it ok to release when I call a "UITableViewController" and not ok when I call a "UIViewController".
And this behavior is the same if the main controller is also a "UIViewController".
Thanks in advance.