iOS 7将UIView更改为UITableView [英] iOS 7 change UIView to UITableView

查看:45
本文介绍了iOS 7将UIView更改为UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode版本5.0(5A1413),并针对iPhone的iOS7.我只有一个带有表视图的UIViewController.我发现的所有内容都只是设置表的dataSource并委托给ViewController.无论我做什么,该应用程序都立即崩溃.即使根本没有手动编写代码,视图也永远不会加载.不再可以将表放到非TableViewController上吗?

I'm using Xcode Version 5.0 (5A1413) and targeting iOS7 for iPhone. I have nothing but a UIViewController with a Table View on it. Everything I've found says to just set the table's dataSource and delegate to the ViewController. No matter what I do the app just crashes immediately. The view never loads even though there's no code written manually at all. Is it no longer possible to put a table onto a non TableViewController?

推荐答案

Delegate Datasource 添加到界面:

@interface MyViewController : UIViewController 
                              <UITableViewDataSource, UITableViewDelegate>

这篇关于iOS 7将UIView更改为UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆