私は2つのView Controllerを持っています。最初のView Controllerには名前のリストがあります。それをクリックすると、同じ名前が2番目のView Controllerに表示されます。
以下のコードがあります。
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// PropDetailViewController is second view controller
PropDetailViewController *prop = [self.storyboard instantiateViewControllerWithIdentifier:@"prop"];
ListOfProperty *propList = [propListFinal objectAtIndex:indexPath.row];
NSString *myText = [NSString stringWithFormat:@"%@", propList.addressOfFlat];
prop.detailLabel.text = myText;
prop.title = myText;
[self.navigationController pushViewController:prop animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
でPropDetailViewController
、私は持ってい@property (retain, nonatomic) IBOutlet UILabel *detailLabel;
ます。
私が期待していたのは、 say をクリックするとName 1
、Name 1
UILabel と UINavigationBar にもテキストとして表示されることです。ただしName 1
、UILabel ではなく、ナビゲーション バーでのみ表示されます。