在modalViewController中使用indexPath.row时崩溃

我有一个indexPath.row的问题,当我尝试访问此变量时,我的应用程序崩溃,我在控制台上没有错误:( 代码是这样的:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.
    NSLog(@"%@", indexPath); //works fine
    NSLog(@"%@", indexPath.row); //crash
}
我在ModalViewController中使用它。     
已邀请:
你必须使用
NSLog(@"%d", indexPath.row);
代替
NSLog(@"%@", indexPath.row);
这是因为,indexpath.row是一个整数,你必须使用%d。     

要回复问题请先登录注册