0

好的,所以我的智慧到此为止。我已经尝试了所有可以想象的事情来摆脱这些错误

这是我的代码:

  - (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];
 }
}

并且错误出现在它说“NSInteger row = [indexPath.row];

请帮忙!谢谢!

4

2 回答 2

3
NSInteger row = [indexPath.row];

点符号或 [] 但不能同时使用!

thyrgle首先得到它...

stringWithFormat 中使用的“ %&”格式说明符让我有点困惑。应该是这样%@吗?是%&真正的格式说明符吗?它有什么作用?谷歌,它什么都不做......

于 2010-06-12T22:29:46.150 回答
0

好的,是的,我将其更改为 [indexPath row] 并且有效。

我不确定 %&,我从教程中得到它并且它有效。这是我知道的全部

于 2010-06-14T22:59:33.967 回答