我遇到了與我的performSegueWithIdentifier問題,因爲他觸發,當我得到他的NextViewController的viewDidLoad他輸入並執行罰款的斷點。問題是沒有輸出,屏幕繼續顯示CurrentViewController。什麼可能是錯誤?performSegueWithIdentifier不顯示新視圖
(CurrentViewController是TableViewController)
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
_selected = [self.evlist objectAtIndex:indexPath.row];
[self performSegueWithIdentifier:@"eventlist" sender:self];
return indexPath;
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSString * event_id = [_selected objectForKey:@"id"];
NSString * event_name = [_selected objectForKey:@"label"];
[segue.destinationViewController setEvent_id:event_id];
[segue.destinationViewController setEvent_id:event_id];
[segue.destinationViewController setEvent_name:event_name];
}
(NextViewController是一個視圖控制器)
- (void)viewDidLoad
{
[super viewDidLoad];
_evname_label.text = _event_name;
_evid_label.text = _event_id;
NSLog(@"This is strange %@",_event_name);
}
他記錄一切如預期...視圖不顯示!
你有沒有在prepareForSegue中放置一個斷點?如果它沒有達到它發佈故事板的相關部分的屏幕截圖。如果它到達它檢查prepareForSegue內segue的名稱是eventList – Gruntcakes
他達到該斷點,甚至正確傳遞參數..猜我將不得不刪除並重新開始xD –