我使用XIB文件创建了控制器,并尝试从最初的rootviewController加载控制器。我包含了表视图,在文件的所有者中,我提到了类名,并将文件所有者拖到了视图中。我的代码是
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
NSLog("It did enter the didselectRowAtIndexPath")
if (indexPath.section == 0){
let enrolledView = DetailsViewController()
let top : UIViewController = (UIApplication.sharedApplication().keyWindow?.rootViewController)!
top.presentViewController(enrolledView, animated: true, completion: {
NSLog("Loading Details view controller")
})
}
if (indexPath.section == 1){
let appcatalog = AppCatalogViewController()
let top : UIViewController = (UIApplication.sharedApplication().keyWindow?.rootViewController)!
top.presentViewController(appcatalog, animated: true, completion: {NSLog("Loading web View")})
}
if (indexPath.section == 2){
let support = supportViewController()
let top : UIViewController = (UIApplication.sharedApplication().keyWindow?.rootViewController)!
top.presentViewController(support, animated: true, completion: {
NSLog("Loading the supportViewController")
})
}
}
但是仍然有这个警告(作为标题提到)并且屏幕重现相同。任何人都可以帮忙吗?提前谢谢你。
答案 0 :(得分:0)
你在xib中使用UITableView吗?
在这种情况下,作为UIViewController的所有者文件必须将此视图添加到层次结构中。
在UIViewController的viewDidLoad中,添加:
ul:nth-child(1) {
animation: fcolor 100ms ease 0ms;
}
ul:nth-child(2) {
animation: fcolor 100ms ease 30ms;
}
ul:nth-child(3) {
animation: fcolor 100ms ease 60ms;
}
...
myTableView应该是TableView的IBOutlet