我在下面的代码中有indexPath
类型NSIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
在调试器中,indexPath不显示某些字段,如section或row
它会尝试po
和p
,但会显示
(lldb) p indexPath.row
error: property 'row' not found on object of
type 'NSIndexPath *' error: 1 errors parsing expression
(lldb) po
indexPath.row error: property 'row' not found on object of type
'NSIndexPath *' error: 1 errors parsing expression
po indexPath
<NSIndexPath: 0xc000000000200416> {length = 2, path = 4 - 1}
答案 0 :(得分:3)
po
通常用于打印对象描述
有关价值,请尝试使用p
:p indexPath.row