Wednesday, 15 October 2008

IPhone Development - Tab Bar View Controller

So, I've been learning to play with the Cocoa Touch framework... in all it's wonderful complexities. The first issue that I came along was with a Tab Bar View (Controller). My trouble was once I had created a new tab bar item, I couldn't get it to link to an external Nib file. Here is the solution (I'll point out the bit that I was missing). Let's pretend the new view and controller are called FunnyView and FunnyViewController.

Once you have created your external Nib for Funny View, you need to set the File's Owner to be FunnyViewController (it's in the Class box on the inspector pane). This is where I stopped, and hence nothing worked! This also however needs to be done for the TabBar View Controller. Click on the tab you want, then set the class of that to be FunnyViewController also. Now you should have a working tab... you can go ahead and set outlets and actions as you so wish now...

No comments: