Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-30-2009, 09:35 AM   #1 (permalink)
alexrrr
Registered Member
 
Join Date: Jun 2009
Posts: 7
alexrrr is on a distinguished road
Default IUViewController with table

Thank you for taking the time to look at this post,

I have in one project i have a UIViewController called DemoTableViewController Defined like this:

Code:
@interface DemoTableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
with an outlet, so when the data gets updated I just call "reloadData" on this.
Code:
IBOutlet UITableView *theTable;
Then in the NIB i hook up:
  • Files Owner to the UIView
  • Set the class of File's Owner to be DemoTableViewController
  • Add a Table View to the view, hook up the Delegate/Datasource to File's Owner
  • Hook up the "theTable" outlet to point to the TableView.

This works perfectly.

I have used UIViewController instead of UITableViewController because i don't want the table to take up the whole screen as i would like to add a toolbar.

However if I try the SAME exact thing on an app that has a navigation controller, adding the view like this:

Code:
DetailViewController *detailView = [[UIViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
	detailView.title = [self.list objectAtIndex:row];
	self.myDetailView = detailView;
	
	AlexNavAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
	UINavigationController *navController = [delegate navigationController];
	[navController pushViewController:self.myDetailView animated:YES];
I get an error like:

Code:
2009-06-30 07:57:18.666 AlexNav[7027:20b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x550c70> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key theTable.'
If i "unhook" the outlet "theTable" then i get on gdb:

Code:
009-06-30 08:25:23.227 AlexNav[7109:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x550a10'
I just dont know what to do, I've read everything i can, and search (really searched) this forums and i can find an answer. This post has something similar but they are using UITabBarController which has multiple UIViewControllers which all separately have their own NIB file assigned. And this is not the case.

It seems to me that even though im pointing the datasource/delegate for the table in the NIB, it is not looking there for them.


Any ideas are welcome, I don't know where to look anymore


Greetings,


Alex
alexrrr is offline   Reply With Quote
 

» Advertisements
» Online Users: 463
21 members and 442 guests
Absentia, ageorgios, baja_yu, bignoggins, cgokey, dana0550, Droverson, gdogdev, ggoodoffer, iOS.Lover, ipodphone, JoePitto, linkmx, mer10, orninn, pgw3, pipposanta, QuantumDoja, rijeka2008, scubadivingfool, sirenum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,639
Threads: 94,102
Posts: 402,830
Top Poster: BrianSlick (7,990)
Welcome to our newest member, sCarlRodriguezj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:08 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.