espera “:” antes de “]” señal + confundido por los errores anteriores, el rescate de
-
26-09-2019 - |
Pregunta
La autorización así im al final de mi ingenio aquí. He intentado todo lo imaginable para deshacerse de estos errores
Heres mi código:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
/*
//<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
*/
NSInteger row = [indexPath.row];
if (self.nameExcerptPage == nil) {
NameOTWexcerpt *nameExcerptPageDetail = [[nameExcerptPage alloc] initWithNibName:@"NameOTWexcerpt" bundle:nil];
self.nameExcerptPage = nameExcerptPageDetail;
[nameExcerptPageDetail release];
nameExcerptPage.title = [NSString stringWithFormat:@"%&", [TheBookNavTabs objectAtIndex:row]];
Rothfuss_ReaderAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.SecondTableViewController pushViewController:TheBookNavTabs animated:YES];
}
}
y aparece el error donde dice "fila NSInteger = [indexPath.row];
ayuda por favor! gracias!
Solución
NSInteger row = [indexPath.row];
De cualquier notación de puntos o [], pero no tanto!
thyrgle consiguió por primera vez ...
El "%&
" especificador de formato utilizado en stringWithFormat me tiene un poco confundido. Si ese fuera %@
? Se %&
un especificador de formato real? ¿Qué hace? El Google, no hace nada ...
Otros consejos
Ok, sí que lo cambié a [fila indexPath] y funcionó.
No estoy seguro sobre el% y, lo tengo de un tutorial y funciona. Eso es todo lo que sé
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow