为什么不能'自我'认出来?

shu*_*low 1 recursion ios lldb

我正在开发iOS应用程序.

我想在一个页面上使用recursiveDescription,它在lldb上有UITableView.我移到页面上方,然后我通过暂停按钮停止应用程序.我收到以下错误.

(lldb) po [self.workview recursiveDescription]
error: use of undeclared identifier 'self'
error: 1 errors parsing expression
(lldb) po [self.view recursiveDescription]
error: use of undeclared identifier 'self'
error: 1 errors parsing expression
Run Code Online (Sandbox Code Playgroud)

self.workview是UITableView的实例.为什么不能'自我'认出来?

Cal*_*leb 5

然后我通过暂停按钮停止应用程序......为什么不能'自我'识别?

如果您通过单击Xco​​de中的暂停按钮来停止应用程序,则无法控制应用程序停止时正在执行的代码.执行可以在任何地方停止,并且如果self在任何停止的地方都被定义,那么很有可能它不会被定义为您想要的对象.

不要使用暂停按钮,而是在要调试的类的源代码中设置断点.