Ho seguito un tutorial per l'utilizzo di UITableView
. Il codice finitoCosa fa @ [indexPath]
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if(editingStyle == UITableViewCellEditingStyleDelete)
{
Message *message = [messageList objectAtIndex:indexPath.row];
[self.persistencyService deleteMessagesFor:message.peer];
[messageList removeObject:message];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft];
}
}
La mia domanda è: Che cosa vuol @[indexPath]
fare? È lo stesso di ?:
[NSArray arrayWithObject:indexPath]
Vorrei anche impostare la risposta come risposta accettata, ma purtroppo SO non lo consente. Perché Emilio è stato più veloce, devo dargli i crediti. Ma bella spiegazione! – Michael90