开发者

UIViewControllers - TabBarApplication - iPhone SDK

开发者 https://www.devze.com 2022-12-28 15:04 出处:网络
I am very new to the iPhone SDK. I need to know if in a tab bar application I need to make UIViewController classes. For example, when I make a new tab bar application there is a default FirstViewCont

I am very new to the iPhone SDK. I need to know if in a tab bar application I need to make UIViewController classes. For example, when I make a new tab bar application there is a default FirstViewController class (.h, .m) already there. Now if I have code开发者_Python百科 on the second tab, would I need to create a SecondViewController class? If not, how would I make a button on the 2nd tab, and make that button do something. I'm not really sure how to do it, because the FirstViewController works with the buttons and code, but if I make a SecondViewController, and I link everything my app crashes.

If anyone could help it would be greatly appreciated.

Kevin


Yes, each tab needs it's own view controller and it's own view nib. If you look in the inspector in IB for the tab itself you will see that you can set the number of tabs and if you select each tab you can tell it which class handles that tab. Make sure that you set the File's Owner for each nib file to the correct view controller class. You don't need to make any connections between the various tab's controllers. If you're in doubt about something check all the connections for the FirstViewController files(.h, .m, and .xib). If you still have issues post as many details as you can as something must be screwy somewhere.

0

精彩评论

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

关注公众号