Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么lldb';s po命令可以';用点打印superview?_Ios_Objective C_Xcode_Lldb - Fatal编程技术网

Ios 为什么lldb';s po命令可以';用点打印superview?

Ios 为什么lldb';s po命令可以';用点打印superview?,ios,objective-c,xcode,lldb,Ios,Objective C,Xcode,Lldb,如果我想要po子视图的superview,当我使用subView.superview时,它将不会被找到,但是如果我使用[subView superview],po命令将运行良好,这背后的原因是什么 (lldb) po self.blackView.superview error: property 'superview' not found on object of type 'UIView *' error: 1 errors parsing expression (lldb) po ((UI

如果我想要po子视图的superview,当我使用subView.superview时,它将不会被找到,但是如果我使用[subView superview],po命令将运行良好,这背后的原因是什么

(lldb) po self.blackView.superview
error: property 'superview' not found on object of type 'UIView *'
error: 1 errors parsing expression
(lldb) po ((UIView*)self.blackView).superview
error: property 'superview' not found on object of type 'UIView *'
error: 1 errors parsing expression
(lldb) po [self.blackView superview]
<UIView: 0x15d53ce50; frame = (0 0; 375 667); autoresize = W+H; layer = <CALayer: 0x15d53cfc0>>
(lldb)po self.blackView.superview
错误:在“UIView*”类型的对象上找不到属性“superview”
错误:1解析表达式时出错
(lldb)po((UIView*)self.blackView).superview
错误:在“UIView*”类型的对象上找不到属性“superview”
错误:1解析表达式时出错
(lldb)po[self.blackView superview]

它们通常不是真正的解析问题,而是“类型信息质量”问题。在本例中,superview实际上是UIViewHierarchy类别中的一个属性,而clang的调试信息中存在一个bug,导致它无法为类别中的属性生成调试信息。编译器不会将属性访问转换为方法调用,除非它知道类型

如果您使用的是Xcode7,通常可以通过指示lldb为感兴趣的框架构建模块来解决使用“模块”特性的框架(包括大多数Apple框架)的类型信息问题,因为该框架具有更丰富的类型信息。您可以通过发出lldb命令来执行此操作:

(lldb) expr @import UIKit

在尝试使用表达式之前,请尝试运行该选项,看看效果是否更好。

您使用的是哪个XCode版本?当使用多个点时,LLDB会出现解析问题。第一个可以工作,而后面的则不行。@Leo Xcode 7.1被使用