|Nov 22, 2009, 02: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 23, 2009, 12:24 AM||#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, 02: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, 03:37 AM||#4|
|Nov 23, 2009, 04: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|
|Two TableViews in the one Window - Datasource??||Fritzables||Mac Programming||4||Jun 21, 2011 11:46 AM|
|Showing date from two rows in table view, in two text fields, via bindings||Monaj||Mac Programming||0||Nov 21, 2010 11:35 PM|
|Adding two videos in one timeline in Encore CS5||Hassan69||Digital Video||1||Jul 18, 2010 02:28 PM|
|Detecting intersection of two imageviews in different views||drf1229||iPhone/iPad Programming||4||Jan 24, 2010 10:35 PM|
|What layering software can i get to put two pictures in a sequence?||diehardmacfan||Digital Photography||3||Jul 21, 2007 02:30 PM|
All times are GMT -5. The time now is 01:56 AM.