views:

2982

answers:

4

From what I understand of the SDK, this exception is raised when the bindings in IB are not proper. But in my case, the view is loaded fine for the first two times. I then move back from the view using the NavigationController.

The third time when I try to open the view, I get this exception. The fact that it opens correct the first two times, means the bindings are correct and the view is fine! But then why does it fail the third time?

Any pointers? Thanks.

I am calling -initWithNibName:bundle: to initialize the view which is created in IB. Not calling the -loadView method.

A: 

The view object might be going out of scope, and getting garbage collected.

diclophis
There's no garbage collection on the iPhone platform (only the most recent version of the desktop objective-c runtime added it)
rpetrich
A: 

It is not getting garbage collected. AFAIK, there is no garbage collection in iPhone SDK and we need to dealloc stuff explicitly.

lostInTransit
Chris Hanson
+1  A: 

You may be running low on memory, which forces the system to send out low-memory messages to instantiated view controllers. The default implementation of -didReceiveMemoryWarning clears out the view member variable. In theory, then next time the view is required, it should be re-instantiated, but you may have overridden something that's preventing that.

Ben Gottlieb
+3  A: 

It seems that you have not bind the view to it's file owner.

For fixing this thing go open the xib which you are using in this ViewController. Right Click on your main view and then bind this view to the File Owener's view property.

Om Prakash