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 01-20-2010, 12:57 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 8
Send a message via Skype™ to ideafactory
Default cellForRowAtIndexPath never get called in Navigation-based Application

Hi!
I have a Navigation-based Aplication where I have many view controllers each one with a tableview.
The access to the view controllers depends on which row the user selects.
Now i'm having a problem which is: when i select a row in the first viewcontroller i go to the second view controller but the tableview in the second view controller isn't loading. The method cellForRowAtIndexPath is never called. I get the tableview but with nothing in the rows. The tableview delegate and datasource is set to the files owner in the xib.

I will put some code to understand what i'm saying.

In the first view controller i call the second this way:

Code:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
	(...)
	
	if (self.tasksController == nil) {
		TasksViewController *taskCont = [[TasksViewController alloc] initWithNibName:@"TasksViewController" bundle:nil];
		self.tasksController = taskCont;
		[taskCont release];
	}
	
	[self.navigationController pushViewController:tasksController animated:YES]; // "Pushing the controller on the screen" 
}
Thanks for your help!
ideafactory is offline   Reply With Quote
Old 01-20-2010, 02:00 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,129
Default

Why is it so hard for people to post the code from the file that actually has the problem?

If your table isn't populating, then there is something wrong with your table view datasource. Either your data is not configured correctly, or your delegate methods are doing something wrong, or the delegate is not correctly configured, or any other number of possibilities that are not in any way related to the code that you posted.

If you succeeded in displaying the second view controller at all, then you already know that the code you posted works just fine. If you didn't get to the next view, THEN the problem could be here (although not necessarily).
__________________
BriTer Ideas LLC - Code review, consulting, development. PM for pricing.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
BrianSlick is offline   Reply With Quote
Old 01-21-2010, 04:49 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 8
Send a message via Skype™ to ideafactory
Red face

Thanks for the advise. I'd discovered what was the problem. I forgot to set the number of rows correctly. My apologize for the stupid question. I put that code because i'm new in iphone development and it's the first time that i develop an navigation-based application.
ideafactory is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, uinavigationcontroller, uitableview

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: 256
21 members and 235 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, dacapo, Dani77, DarkAn, Desert Diva, HemiMG, iDifferent, jakerocheleau, JasonR, prchn4christ, Rudy, ryantcb, Speed, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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