- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
//Some code to go to the next page
NSString *selectedCountry = [arraycountries objectAtIndex:indexPath.row];
NSString *selectedCountry1 = [arycountries objectAtIndex:indexPath.row];
p开发者_开发知识库rofilepage *detailViewController = [[profilepage alloc] initWithNibName:@"profilepage" bundle:nil];
detailViewController.selectedCountry = selectedCountry;
detailViewController.selectedCountry1 = selectedCountry1;
// ...
// Pass the selected object to the new view controller.
[self.navigationController popViewControllerAnimated:YES];
[detailViewController release];
This is my code,how can i pass selectedCountry and SelectedCountry1 to profilepage,,,
i try but,i didnt get any values, please help me,thnkzzz
If detailViewController
is the next view, you should be using pushViewControllerAnimated:animated:
instead of popViewControllerAnimated:
. Logically, push goes forward and pop goes backward.
The navigation stack is described in the Navigation Controllers section of the View Controller Programming Guide.
[self.navigationController popViewControllerAnimated:detailViewController
animated:YES];
[detailViewController release];
精彩评论