ios - NSBundle.mainBundle() 返回 nil

标签 ios nsbundle mainbundle

我刚刚重新安装了我的 mac 和 Xcode。然后[NSBundle mainBundle]由于某种我不知道的原因,总是返回 nil。

非常感谢你!

这是我的调试 Pane 的屏幕截图:

enter image description here

最佳答案

您已经在 Release模式下构建了代码。在 Release模式下,调试器是不可靠的。变量可以被优化掉。切换到 Debug模式,然后重试。

关于ios - NSBundle.mainBundle() 返回 nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35881082/

相关文章:

ios - 在 scrollview swift ios 中添加 imageview 作为 subview

ios - XCode 6.3.1 在重命名项目时崩溃

objective-c - 安装后应用程序无法正常运行

iphone - [NSBundle mainBundle] 声明的 CFString 对象

ios - 通过 iOS 应用程序将图像上传到 Salesforce

ios - NSURLSessionUploadTask 创建后立即取消

iphone - 检查包中是否存在文件

ios - 如何在 iOS 中将 .m 文件读取为 NSString

ios - 引用 iOS 应用程序的 Xcode 项目中的目录