Q:

Why I cannot use IBOutlet named "title" in cocoa?

I have view controller, and inside I have IBOutlet UITextField *title , which is connected with some UITextField in .xib file. When I try to push this view controller to navigation controller, my app throws NSException. And when I change the name of IBOutlet, everything is ok. I saw some guys here had similar issue, but I'm asking WHY is it so ? Is it some kind of reserved word or some bug?

A:

The UIViewController already has a title property that is of type NSString. This is the title you normally see in a navigation conroller. Use a better name like titleLabel otherwise there will be a race to set title, depending on when set it will be an NSString and others some UI element. Your scenario it sounds like the title was set to a UI element and when your navigation controller goes to display it, it is sending a message for NSString which will result in an exception.

