Playground execution failed: error: Couldn't lookup symbols

Playground execution failed: error: Couldn't lookup symbols

我正在使用 Xcode 7.3。我已经将 Playground 和 Frameworks 放在同一个工作区中并构建了框架。我仍然收到此错误

Playground execution failed: error: Couldn't lookup symbols:  
_RestofireVersionNumber

如何解决这个问题?

如果您的图书馆有 .podspec,您可以使用 cocoapods-playgrounds 生成一个应该可以工作的游乐场。

$ gem install cocoapods-playgrounds
$ pod playgrounds Restofire.podspec

看起来这个插件也有对 Carthage 项目的暂定支持。

该插件会在您的项目文件夹中创建一个新文件夹,结构如下:

RestofirePlayground
├── Podfile
├── Podfile.lock
├── Pods
│   ├── Alamofire
│   ├── Headers
│   ├── Local\ Podspecs
│   │   └── Restofire.podspec.json
│   ├── Manifest.lock
│   ├── Pods.xcodeproj
│   └── Target\ Support\ Files
│       ├── Alamofire
│       ├── Pods-TidalPlayground
│       └── Restofire
├── Restofire.playground
├── Restofire.xcodeproj
└── Restofire.xcworkspace

生成 Playground 后剩下的就是构建 RestofirePlayground 方案,然后就可以开始了。