Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lildragon

macrumors newbie
Original poster
Jun 23, 2009
13
0
Hiya guys, I'm in need of a bit of help with something I'm trying to accomplish.

I'm following James brilliant tut here http://www.vimeo.com/4934632 and got everything working with the detailViewController and NSArray and so fourth. But now I would like to have each cell select a different DetailView .nib and I'm not sure how to do that from an Array... Any help would be greatly appreciated.

BTW apple's sample Navbar code does what I need, I just need some help breaking this down.

Cheers,

~t
 
Do you mean each cell in the table view now if selected will push a different view controller, instead of all cells push the same view controller ?
 
Yes exactly! I've been playing around with Apple's sample code UICatalog And this actually seems better. I've been studying their source code and came up with something like this

Code:
// for table 1:
	Article1DetailViewController *article1DetailViewController = [[Article1DetailViewController alloc]
							initWithNibName:@"Article1DetailViewController" bundle:nil];
	[self.tableDataList addObject:[NSDictionary dictionaryWithObjectsAndKeys:

							 article1DetailViewController, kViewControllerKey,
							  nil]];
	[Article1DetailViewController release];
	[self.navCont pushViewController:article1DetailViewController animated:YES];

It's fuzzy to say the least, any ideas/tips?

thx!

~t
 
Then in the code that you handle the cell tap event, you just load the corresponding view controller from Nib file and then push onto the navigation controller. Am i rite ?
 
Well I got it working.. mostly with the above code and picking apart the UICatalog code from Apple. Works great now..

Cheers
 
Could you please email me your code so I can get an idea on how to do this? Or post it?


Thanks
Greg

gregrlevy@aol.com


I could but it's a bit of code to post, just grab the UICatalog link I posted and sift through that. The snippet of code I posted above is important also. Any specific questions I'll try my best to answer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.