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 *)tableView

UITableView *)tableView willSelectRowAtIndexPath

NSIndexPath *) 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!