Exception if there is IBOutlet in view controller created by initWithNibName
Posted
by Kail
on Stack Overflow
See other posts from Stack Overflow
or by Kail
Published on 2010-05-30T10:53:56Z
Indexed on
2010/05/30
11:02 UTC
Read the original article
Hit count: 247
iphone
|iphone-sdk-3.0
When I create a Navigation-based application, the second view controller is created with initWithNibName, if I add a label onto the second view and connect it with IBOutlet in the second view controller. After I navigate to the second view by clicking table cell, and then back to the root view, the application aborts - send message retainCount to a freed object.
I know this is caused by the IBOutlet label, which is retained, set nil in viewDidUnload and dealloc in dealloc. But I don't know why, and if I wanna still use IBOutlet, what can I do? Not dealloc it in viewcontroller's dealloc?
Anybody could help? Thank you.
© Stack Overflow or respective owner