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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-30-2009, 10:35 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 7
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
Old 06-30-2009, 11:40 AM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 536
Default

You are creating a UIViewController instead of a DetailViewController. Look here:

Code:
DetailViewController *detailView = [[UIViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
I think you meant to say:

Code:
DetailViewController *detailView = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
eddietr is offline   Reply With Quote
Old 06-30-2009, 01:17 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 7
Default

Quote:
Originally Posted by eddietr View Post
You are creating a UIViewController instead of a DetailViewController. Look here:

Code:
DetailViewController *detailView = [[UIViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
I think you meant to say:

Code:
DetailViewController *detailView = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];

Eddietr, you are now my new personal hero! Thanks a million. I spent FOUR days, FOUR DAYS! on this... man it sucks to be such a noob. Where should i send the cold beer?


Again thank you!!!


Alejandro
alexrrr is offline   Reply With Quote
Old 06-30-2009, 01:55 PM   #4 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 536
Default

Quote:
Originally Posted by alexrrr View Post
Eddietr, you are now my new personal hero! Thanks a million. I spent FOUR days, FOUR DAYS! on this... man it sucks to be such a noob. Where should i send the cold beer?


Again thank you!!!


Alejandro
Oh, I've been there. It's always easy to find mistakes that you didn't write yourself!

Good luck with the rest of your app.
eddietr is offline   Reply With Quote
Old 02-25-2010, 12:25 AM   #5 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
Post

Hi

i am also facing the same problem.
i am using a Navigation Controller without UITableView.
i want to add some more graphics to the interface builder
with UITableView but i am confused with DataSource and
Delegate objects because i am connecting data source and
delegate objects to File Owner which gives me this error.

Thanks in advance.

error >>>>

2010-02-25 10:08:45.721 Check[11300:20b] *** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xd19560
2010-02-25 10:08:45.723 Check[11300:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xd19560'
<<<<
asadullah797 is offline   Reply With Quote
Reply

Bookmarks

Tags
interface builder, table view, uiviewcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 351
20 members and 331 guests
ADY, Dani77, e2applets, Herbie, JasonR, keeshux, linkmx, mer10, Monstertaco, piesia, prchn4christ, Promo Dispenser, Robiwan, sebasx, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,760
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:31 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0