Application crashing with segue identifier in UITableViews
-
13-11-2019 - |
Вопрос
I am trying make a segue call in a tableview , but the application crashes when I click on the cell ...
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
switch (indexPath.row){
case 0:
[self performSegueWithIdentifier: @"segue1" sender: self];
break;
case 1:
[self performSegueWithIdentifier: @"segue2" sender: self];
break;
case 2:
[self button1];
break;
case 3:
[self button2];
break;
}
case 2 and 3 work perfectly fine , but case 0 and 1 crash with the following green error :
thread 1:Program received signal "SIGBART".
thanks
Решение
Make sure that the table/cell you are clicking on is associated with a view controller that has a storyboard.
The storyboard initiates the segue so when you say
[self ...]
It's saying tell MY storyboard to initiate the segue.
Initiates the segue with the specified identifier from the view controller’s storyboard file.
Не связан с StackOverflow