I have table view which is populated from an array grabbed from a url. I set the title of each row with a few characters from the string object of array and when the cell is clicked a new view is pushed. In this new view i have a UILabel. At this point what i want is, to set the title of this lable with the full string of that index..
Here is my code:
NSDictionary *object=[[NSUserDefaults standardUserDefaults]objectForKey:@"savedMessage"];
NSArray *array= [object valueForKey:@"message"];
cell.textLabel.text= [array objectAtIndex:indexPath.row];
and by the following code i push new view:
messageDetail *detailViewController = [[messageDetail alloc] initWithNibName:@"messageDetail" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
detailViewController.title=@"Message Detail";
[detailViewController release];
What i want is, how can display any result(detail) of the array at its own index?
(for example, when i clicked the 5. row i want my detailViewController’s label be set as the 5. object of array)
You create a function in messageDetail.m called like so:
And then you call it in the didSelectRowAtIndexPath in tableViewController