Xcode 7.3:app delegate无法访问自己的对象,上下文声称捕获了一个Objective-C对象但是self不可用

Aug*_*ust 9 iphone macos xcode ios

在MacOS 10.11.3和10.11.4上的xcode 7.3中,当我在任何app委托方法中停止调试器并尝试检查在app委托中实例化的任何对象,甚至是app委托本身时,我在调试器中收到此警告:

 error: warning: Stopped in a context claiming to capture an Objective-C object pointer, but 'self' isn't available; pretending we are in a generic context

 error: member reference type 'AppDelegate *const' is a pointer; did you mean to use '->'?

 error: incomplete definition of type 'AppDelegate'

 note: forward declaration of 'AppDelegate'

 error: 2 errors parsing expression
Run Code Online (Sandbox Code Playgroud)

这个特定的时间我在app委托中application:didFinishLaunchingWithOptions: method,但在app 代理中的任何方法停止,在运行应用程序的任何时候,在尝试查看任何app delegate的对象时都会出现相同的错误.

xcode 7.2不会发生这种情况.我注意到在7.2中self,app委托被列为(AppDelegate*),而在7.3中它是(AppDelegate*const).单击自定义旁边的显示箭头以显示应用程序委托,但在7.3中没有显示任何内容,而在7.2中则显示.

这是在模拟器和实际设备上.

关于什么可能是错的任何想法?

八月

小智 6

我也遇到了对象C的问题(没有在swift 2上测试过).我尝试使用命令行工具到7.2.1但不工作,1小时后我尝试通过"[]"而不是"."访问属性..它工作=)).

例:

 [Restaurant name]
Run Code Online (Sandbox Code Playgroud)

代替

Restaurant.name
Run Code Online (Sandbox Code Playgroud)

更新:找到另一种方法来修复对象C项目的这个bug

Xcode 7.3调试器没有显示自定义类变量

希望它有用


Moj*_*o66 6

在"构建设置"中,尝试设置Precompile Prefix HeaderNO.