安装CocoaPods Podfile后,Xcode调试器不显示变量信息 [英] Xcode debugger doesn't display variable information after installing CocoaPods Podfile

查看:262
本文介绍了安装CocoaPods Podfile后,Xcode调试器不显示变量信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了CocoaPods,并在Xcode中为我的项目添加了一个pod,以便我可以使用Google Maps SDK for iOS,现在我无法获取调试器控制台中任何变量的类型或值。我可以看到变量值的唯一方法是通过代码中的打印语句。



我在Xcode 7.0测试版中使用了Swift 2.0,我几乎按照这些说明完全将pod安装到我的项目中: https://developers.google.com/ maps / documentation / ios-sdk / start 。我唯一不同的是将Podspec中的第二行从platform:ios,8.1更改为platform:ios,9.0。



我看了这个类似的问题的答案: Xcode调试器有时不显示变量值?,但是我已经在使用调试版本,而且我很确定我的问题与CocoaPods有关,因为在我添加到我的项目之前,一切正常工作。

解决方案

这是已知问题,您可以找到更多信息,并加上星号isuue 这里



TL-DR - 快速解决方法:



添加Objective-C桥ging头文件并添加 #import< GoogleMaps / GoogleMaps.h>



删除所有导入Google地图从您的快速文件



PS:Tricky的东西 - 你必须从swift文件中删除所有的导入 - 我已经忘记删除该文件,导致此调试问题。 / p>

I just installed CocoaPods and added a pod to my project in Xcode so that I could use the Google Maps SDK for iOS, and now I'm not able to get types or values for any variables in the debugger console. The only way I can see a variable's value is through a print statement in the code.

I'm using Swift 2.0 in Xcode 7.0 beta, and I followed these instructions almost exactly to install the pod into my project: https://developers.google.com/maps/documentation/ios-sdk/start. The only thing I did differently was to change the second line in the Podspec from "platform :ios, '8.1'" to "platform :ios, '9.0'".

I looked at the answers to this similar question: Xcode debugger sometimes doesn't display variable values?, but I was already using a debug build, and I'm pretty sure my problem is related to CocoaPods, because everything was working fine before I added that to my project.

解决方案

This is known issue, you can find more info and starred isuue here.

TL-DR - Quick workaround:

Add Objective-C bridging header file and add #import <GoogleMaps/GoogleMaps.h>"

Remove all "import GoogleMaps" from your swift files

PS: Tricky stuff - you have to remove all imports from your swift files - I have forgotten to remove the one and it causes this debug issue.

这篇关于安装CocoaPods Podfile后,Xcode调试器不显示变量信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆