简体   繁体   中英

Changing UIViewController to UITableViewController

I have iOS App which is master-detail view app. By default is masterview tableview and detailview is clasic UIViewController . Now, I need to change UIViewController to UITableViewController , so I've in detailViewController.h changed this

@interface DetailViewController : UIViewController

into this:

@interface DetailViewController : UITableViewController

And in .xib file, I have set a custom Class to DetailViewController , so it should work... But it didn't... When I try to run app, it returns an error :

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "DetailViewController" nib but the view outlet was not set.'

Where is problem please? Thanks a lot!

You have to delete your view controller object in the xib file and use their UITableViewController from the Utilities tab. So changing subclass in code is not enough, you need to make sure you used proper template in the xib as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM