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 02-04-2010, 12:00 PM   #1 (permalink)
tateyaku
Registered Member
 
Join Date: Feb 2010
Posts: 10
tateyaku is on a distinguished road
Post Table View assistance please

Hello,

I'm new to this site, and the whole iphone dev scene! I've a problem and am requesting some help. Since I am new, there are many terms strategies I don't understand. If possible, talk to me like I'm 4!

My problem: I have a UITableView and when a cell is clicked, it opens another xib/viewController. I've set up a singleton to pass data from the table to the new view. But once the cell is tapped and new view opens, what ever was set in the singleton is the only thing that is set. If you push back and try a different cell, it will not change to that cell's value. I need the value, and not the key. Here are some snippets of my code:

table view view controller.m
- (NSIndexPath *)tableViewUITableView *)tableView willSelectRowAtIndexPathNSIndexPath *) indexPath {

// --- determine which anime was selected ---
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
NSString *key = [keys objectAtIndex:section];
NSArray *nameSelection = [info objectForKey:key];
NSString *selectedItem = [nameSelection objectAtIndex:row];

NameOfAppDelegate *mainDelegate = (NameOfAppDelegate *)[[UIApplication sharedApplication]delegate];
mainDelegate.sharedVar = selectedItem;



if (ViewController == nil) {
self.viewInfoViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]];
}
[self presentModalViewController:self.ViewController animated:YES];

return indexPath;
}



detail view controller.m
List_o_AnimeAppDelegate *mainDelegate = (List_o_AnimeAppDelegate *)[[UIApplication sharedApplication]delegate];
NSString *viewBy = mainDelegate.sharedVar;

self.engTitle.text = viewBy;
[viewBy release];
viewBy = nil;



back button detail view controller.m
-(IBAction) barButtonBack {
[self dismissModalViewControllerAnimated:YES];
}




I've read articles, and tutorials from every corner of the web and I can't figure this one out. I'm not say the information is not out there. I'm just saying that I haven't found it yet, and don't know where to look.

Thanx!
tateyaku is offline   Reply With Quote
 

» Advertisements
» Online Users: 558
15 members and 543 guests
beckz007, BrianSlick, djbrooks111, djohnson, Domele, dylanreich, HemiMG, ilmman, kasumar, larueta13, mariano_donati, Newbie123, shwetap, SLIC, Thompson22
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,446
Threads: 94,031
Posts: 402,604
Top Poster: BrianSlick (7,978)
Welcome to our newest member, larueta13
Powered by vBadvanced CMPS v3.1.0

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