Xcode 4. 将 tableView 添加到选项卡栏应用程序
我在 xcode 4 中创建了一个新的选项卡栏应用程序,它为每个 xib 生成了 mainwindow.xib、firstView.xib、secondView.xib 和 viewController 类。
我想向firstView.xib添加一个tableView,所以我在项目中添加了一个UITableViewController类,并且Xcode生成了一个新的tableViewController.xib,它显示了一个tableView。
我如何连接它以便将 TableView 加载到 xcode 4 中的firstView中。
编辑:
好的,我尝试将 tableViewController 添加到firstView.xib 并将其类名和 nib 属性设置为我的 TableViewController 类的名称,但当应用程序运行时它不可见。
干杯
Ive created a new tab bar application in xcode 4 and it has generated a mainwindow.xib, firstView.xib, secondView.xib and viewController classes for each xib.
I would like to add a tableView to the firstView.xib, so i have added a UITableViewController class to the project and Xcode generated a new tableViewController.xib which displays a tableView.
How do i hook it up so the TableView is loaded into the firstView in xcode 4.
EDIT:
Ok, I've tried adding a tableViewController to the firstView.xib and setting its class name and nib properties to the name of my TableViewController class, but its not visible when the app runs.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在firstView.h中,添加一个代表TableViewController的IBOutlet
在firstView.xib中,将tableViewController链接到相应的File Owner IBOutlet
在firstView.m的viewDidLoad方法中,初始化你的tableViewController。
in firstView.h, add an IBOutlet which will represent the TableViewController
in firstView.xib, link the tableViewController to the corresponding File Owner IBOutlet
in firstView.m, in viewDidLoad method, initialize your tableViewController.
这是一个简单的教程
http://www.techotopia.com/index.php/Creating_a_Simple_iOS_4_iPhone_Table_View_Application_(Xcode_4) )
Here is a simple tutorial
http://www.techotopia.com/index.php/Creating_a_Simple_iOS_4_iPhone_Table_View_Application_(Xcode_4)