|Nov 22, 2009, 01:21 PM||#1|
Putting two tableviews in one view
I want to make a view in which two tableviews must be displayed. To do this, I derived the view controller from UIViewController and put the tableviews in that. Now, I derived a customized class from UITableViewController as the delegate and datasource for one of the views. Siince the instance will be released automatically I put a retain member variable as outlet and assign it to the instance of the customized view controller in the xib. The class name for the customized table view controller is assigned correctly too.
But, when I avtivate the view it stops and debugger shows the message:
this class is not key value coding-compliant for the key tableVC.
tableVC is the member variable in the view controller.
Can anybody please help me. I am working on this problem since two days.
|Nov 22, 2009, 11:24 PM||#2|
I think you would be better off with one custom view controller, adding both table views as subviews to that controller's view, and making the controller the delegate and data source of both table views. Don't introduce a UITableViewController subclass; that's for managing one table view.
North Bronson Software
|Nov 23, 2009, 01:02 AM||#3|
UIViewController as delegate
Thank you for your help. It came on that solution because I didn't manage to put a UIViewController as delegate. So maybe it's better to ask you how to do that:
I derive a custon controller from UIViewController and then I declare it as:
MyCustomViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
and then I implement the necessary methods, namely:
in MyCustomViewDataSource. Then I put a table view in my xib file. Everything is fine. But as soon as I asign the delegate and datasource in IB to the FileOwner (MyCustomViewController) and open the view the program crashes.
The error message is Debugger console says the message below. I am new to XCode and I do not even know how to use these values.
Can you please help me with that?
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xd1cf00'
2009-11-23 07:51:12.378 iMatchU[4780:20b] Stack: (
|Nov 23, 2009, 02:37 AM||#4|
|Nov 23, 2009, 03:00 AM||#5|
UIViewController was not loaded
Thank you for your help. The class contained the method. I had done another stupid mistake. Indeed the application I was writing was TabBarController based and for the second Tab I had specified the xib name instead of putting the appropriate UIViewController as the second selection of tab bar controller. Hence, the controller was not loaded at all and the delegate and source could not be assigned to that.
I guess I need more experience to decrypt error messages of the debugger
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|iPad: Multiple predicates in various tableviews||jsanto||iPad||0||Feb 11, 2013 04:16 PM|
|font in tableviews||LARRYSE||iPhone/iPad Programming||6||Nov 13, 2012 08:27 AM|
|Pushing to a Detail View from a Table View Cell using Xcode Storyboard||xcodeApp10||iPhone/iPad Programming||2||Sep 17, 2012 03:45 PM|
|Difference between a cell and a row in Tableviews?||animefx||iPhone/iPad Programming||4||Aug 7, 2012 02:35 PM|
|Two TableViews in a single ViewController ??||Fritzables||iPhone/iPad Programming||2||Jul 8, 2012 07:25 PM|
All times are GMT -5. The time now is 10:12 PM.