【发布时间】:2014-08-19 19:47:25
【问题描述】:
我在为真机编译项目时遇到此错误。
format 指定类型为“long”,但参数的类型为“int”
在模拟器上一切正常。
如果将“%d”替换为“%ld”,我会得到:
format 指定类型为“int”,但参数的类型为“long”
在这段代码中:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
if (cell) {
cell.textLabel.text = [NSString stringWithFormat:@"page %d", indexPath.row+1]; // <-
}
return cell;
}
我该如何解决?
【问题讨论】:
标签: ios objective-c tableview