ビューに 2 つのコンテナー ビューがあり、左側の分割ビュー コントローラー テーブルビューと右側の詳細ビューを模倣しようとしています。didselect
masters で行を使用すると、詳細ビューtableview
に詳細が表示されるはずです
問題は、データを詳細ビュー コントローラ インスタンスに渡すと、常に null が返されることです。
マスター上:
@property (nonatomic,strong) LogDetailViewController *wods;
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard"
bundle:nil];
self.wods= [sb instantiateViewControllerWithIdentifier:@"LogDetailViewController"];
//also tried self.wods= [[LogDetailViewController alloc] init];
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//one of the if else method rest of it was too long
else if ([indexPath section]==1){
GIRLS *girls =[self.girlsList objectAtIndex:indexPath.row];
self.wods.girls = girls;
self.wods.section=1;
[[NSNotificationCenter defaultCenter] postNotificationName:@"refreshLOGDetails" object:nil];
}
}
詳細に:
@property int section;
@property (nonatomic, strong) GIRLS *girls;
//refresh notification
extern NSString * const NOTIF_refreshLOGDetails;
@synthesize section;
@synthesize girls;
- (void)refreshLOGDetails:(NSNotification *)notif
{
NSLog(@"Notification refreshLOGDetails works");
[self configureView];
}
- (void)configureView
{
//also tried self.girls and self.section
NSLog(@"Section is %i",section);
NSLog(@"configure view object %@",girls);
}
出力:
Notification refreshLOGDetails works
Section is 0
configure view object (null)
私が間違っているのは何ですか?null 値を取得するのはなぜですか?