I have a UIViewController. I boot from the xib file and click on the navigation controller stack.
In the header file for the view controller, I have:
IBOutlet UILabel *myTitle;
I do nothing with "myTitle" in code; I just set up the connections.
When I compile and run the application, and there are no shortcuts defined in the xib file (and therefore nothing tied to IBOutlet), it works. The view controller animates in the view just fine, showing the view that I created in the interface builder.
If I add a shortcut to xib in the interface builder, but donβt plug it in and recompile it, it still works, showing a label with the default text that I entered for it.
But if I connect IBOutlet myTitle to a label in the interface builder, recompile and run the application, it works fine until I try to push the view controller onto the navigator controller stack, after which I get a failure:
*** -[UILabel copyWithZone:]: unrecognized selector sent to instance 0x4558e20
If I unplug the socket again, it resumes work, showing the static label as before. It seems that something funky happens when the view is displayed, because the crash happens when I click the view on the navigation stack.
Shouldn't I add an IBOutlet to UILabel or something else? Or is something else going on? Any suggestions on where to look for problems?
iphone
CC.
source share