views:

63

answers:

1

Hello Everyone!

I am really frustrated and I rally hope that you will help me to solve this problem!

I'm trying to build a tab bar inside a navigation controller. I used this template provided by WiredBob. My problem is that I want to add more bar items to the tab bar, but I keep getting crash!

From the log: 2010-05-24 00:15:43.469 NavTab[9315:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "AnnView" nib but didn't get a UITableView.'

Also, I tried to fix the size of the a view in IB to fit in with the tab bar, but I couldn't! It was unchangeable.

Thanks in advance :-)

A: 

Heba,

Is AnnView supposed to be a UITableView? From the example, it looks like that's probably the case and maybe you are trying to use a standard XIB but have it subclassed as a UITableViewController.

Try going into interface builder, opening up AnnView.XIB and making sure the main view is a UITableView. If not, you should goto the far right tab in the inspector window and change it to a standard UIView. Or in the case that it is supposed to be a UITableView, make sure that is the main view in IB.

A reference for you:

http://twilloapp.blogspot.com/2009/03/how-to-embed-navigation-controller.html

In regards to your other question about changing the size of the view, what kind of view are you using? If it is a UITableView, you can add a "tab bar" to the view in IB to show you what it will look like and the UITableView should resize automagically to match it.

Rob

iWasRobbed
Hi Rob,Thanks for you reply. The answer for your first question is yes. AnnView is a UITableView. You said "Try going into interface builder, opening up AnnView.XIB and making sure the main view is a UITableView. If not, you should goto the far right tab in the inspector window and change it to a standard UIView. Or in the case that it is supposed to be a UITableView, make sure that is the main view in IB." I'm sorry, what do you mean by "main view"? Do you mean changing the class to UIView? Thank you. :-)
Heba
Hi Heba, it sounds like your uitableview isn't hooked up correctly in interface builder. Please open up IB, click "File's Owner" and goto the second tab of the inspector window where all of the hook ups are... Make sure the File's Owner `view` is hooked up to the UItableview Let me know if that fixes it for you!
iWasRobbed
I double checked, and every thing looks fine! But it's still not working!
Heba
Heba, without seeing how you have it hooked up and ensuring you have everything set to the correct class it is difficult to diagnose, but I can guarantee you either have it hooked up incorrectly or you have one of the views set to the incorrect class (last tab in the inspector window.. the AnnView class should be set to a UITableView). That is a very common error message.... Your best bet may be to watch a tutorial such as this one:http://broadcast.oreilly.com/2009/06/tab-bars-and-navigation-bars-t.html or: http://twilloapp.blogspot.com/2009/05/how-to-embed-navigation-controller.html
iWasRobbed