开发者

Connecting a nib to files owner problem

So I am upgrading my iPhone app to be universal. I upgraded the project and than created a new nib for one of my classes. I set the custom class for that nib to my viewController and dragged th开发者_如何转开发e view from files owner to the nib. All worked fine. But than the second time I ran it, I got the following error:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"viewControlleriPad" nib but the view outlet was not set.'*** Call stack at first
throw:

So I disconnected view from the nib, than reconnected it and it worked. So basically the pattern seems to be every time I link it, it works once. This seems really weird. Thanks in advance for any help.


In the new XIB that is created I suppose you have not associated the class of the File's Owner with the class of the view controller

Also you have not set the view outlet of the File's Owner.

Hope you get it.

If you need more help than please let me know.

EDIT:

Please refer to this question:

Iphone sdk tabbar View outlet was not set

EDIT-2:

View Objects don't connect to the File's Owner


This happened to me before as well. It would be worth a try to try the following in this order:

  1. Copy + paste your nib in xcode, rename the old one, name the new one to the old name
  2. Rebuild the nib from scratch if it is not too much trouble
  3. Restart your Mac
  4. Examine the XML for the nib for any oddness

(#2 worked for me)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜