2010-08-08 85 views

回答

1

如果我正確理解了你的話,那麼這並不是什麼大事。你只需要做出TrailViewController一個屬性來保存你的價值,併爲它分配是這樣的:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
     TrailViewController *trailViewController = [[TrailViewController alloc] initWithNibName:@"TrailViewController" bundle:[NSBundle mainBundle]]; 
     NSDictionary *dict = [rows objectAtIndex: indexPath.row]; 
     trailViewController.trailName = [dict objectForKey:@"name"]; 
     [self.navigationController pushViewController:trailViewController animated:YES]; 
     [trailViewController release]; 
} 

而不只是名字,你可能會想完整的NSDictionary分配給TrailViewController的財產,但這取決於你。我希望我能幫到...