本文主要是介绍Static table views are only valid when embedded in UITableViewController instances,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题
当在UIViewController中加入Table View,然后将其Content设置为Static Cells,xcode编译时报错提示:Static table views are only valid when embedded in UITableViewController instances。
解决方法
将放置Table View改为放置Container View;
单独拖出一个Table View Controller,在这里就可以将Table View的Content设置为Static Cells做你想做的事情;
关联,在Container View上按住右键拖出一条线到Table View Controller释放鼠标右键弹出如下窗口,选择Embed,这样就大功告成了。
这篇关于Static table views are only valid when embedded in UITableViewController instances的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!