【问题标题】:Xcode debug doesn't print all fields of objects [duplicate]Xcode调试不打印对象的所有字段[重复]
【发布时间】:2016-03-16 02:34:59
【问题描述】:

我在下面的代码中有一个indexPath,类型为NSIndexPath

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

在调试器中,indexPath 不显示某些字段,如部分或行。
它尝试pop 但它显示了

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

我应该怎么做才能启用它?任何帮助,将不胜感激。

【问题讨论】:

  • with po 所有其他值都是 print ?
  • @Vvk 在我的图片中,你会看到部分和行不打印
  • @PhanVănLinh 实际上 PO 用于打印对象,因此它打印整个对象。您正在尝试打印索引路径的一个字段,所以这是不可能的

标签: ios xcode


【解决方案1】:

po通常用于打印对象描述

为了价值,请尝试使用p 代替:p indexPath.row

【讨论】:

  • p indexPath.row 不要和我一起工作 :(
猜你喜欢
  • 2013-10-01
  • 2010-10-25
  • 2013-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多