Domanda

Ho impostato una UableView utilizzando un NSFetchedResultsController che visualizza un numero di prototipo di UableViewCells. Ho collegato una spinta da seguire dalla mia UableViewCell al mio dettaglio ViewController.

Nel mio tableviewcontroller ho implementato entrambi:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"%s", __PRETTY_FUNCTION__);
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

Quando eseguo l'applicazione e faccio clic su una riga nella visione di tabella, solo le chiamate dell'applicazione:

[TableViewController tableView:didSelectRowAtIndexPath:]
[TableViewController tableView:didSelectRowAtIndexPath:]
[TableViewController tableView:didSelectRowAtIndexPath:]

Se elimino il seguito e lo swire formano un UIBARBUTTONITEM sul dettaglio Visualcontroller, allora il seguito viene chiamato correttamente, qualcuno può pensare a quello che mi manca?

MODIFICARE:

Aggiunto:

- (IBAction)tester:(id)sender {
    [self performSegueWithIdentifier:@"SEGTEST" sender:nil];
}

E lo ha collegato a un Uibuttonbaritem che chiamato "tester" e funziona, non riesco proprio a farla licenziare quando mi collego dall'uitableViewcell al controller.

È stato utile?

Soluzione

After a bit of digging I eventually found that the UITableViewCell identifier was set incorrectly to "CELL_ID" when it should have been "PLANTCELL_ID".

Som for anyone else who finds that selecting a UITableViewCell in a UITableView does not call the associated segue, check if your cell identifier is set correctly in both the storyboard and tableView:cellForRowAtIndexPath:.

Altri suggerimenti

Rewire your segue from the ViewController itself and give it a name. Then in the didSelectRow method call

[self performSegueWithIdentifier:@"yourSegueName"];    

and see if it fires.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top