开发者

expected ":" before "]" token + confused by earlier errors, bailing out

Ok so im at my wit's end here. I have tried every imaginable thing to get rid of these errors

heres my code:

  - (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];
  [detai开发者_开发知识库lViewController 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];
 }
}

and the error appears where it says "NSInteger row = [indexPath.row];

please help! thanks!


NSInteger row = [indexPath.row];

Either dot notation or [] but not both!

thyrgle got it first...

The "%&" format specifier used in stringWithFormat has me a bit confused. Should that be %@? Is %& a real format specifier? What does it do? The Google, it does nothing...


Ok yeah I changed it to [indexPath row] and it worked.

I'm not sure about the %&, I got it from a tutorial and it works. That's all I know

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜