简体   繁体   English

Restkit 0.20.x cocoapods安装问题-编译但找不到RestKit的导入

[英]Restkit 0.20.x cocoapods install issue - Compiles but can't find import of RestKit

I've used RestKit about a year ago when it was going through the transition between 0.1 and 0.2. 大约一年前,我使用过RestKit,当时它正在经历0.1到0.2的过渡。 I had everything running using a manual install. 我使用手动安装来运行所有程序。

I've now started a new project and wanted to use RestKit again. 我现在已经开始了一个新项目,并想再次使用RestKit。 But I can't get it to install properly. 但是我无法正确安装它。 This time I did the cocoa pods method of install and it all looked like it went well. 这次我做了可可豆荚的安装方法,一切看起来都进行得很顺利。 I had included the #import in my .pch file so it was global. 我已经将#import包含在我的.pch文件中,因此它是全局的。

The project compiled and build was successful but when I opened the class file in the editor where I had some RestKit code in (getting the RKManagedObjectStore etc) I was getting semantic errors. 编译和构建项目成功,但是当我在编辑器中打开类文件时,在其中包含一些RestKit代码(获取RKManagedObjectStore等)时,我遇到了语义错误。 It couldn't find the RestKit classes. 它找不到RestKit类。

I removed the import of RestKit from my .pch file and just put it in my header file of the class I was working on I got the error that RestKit could not be found. 我从我的.pch文件中删除了RestKit的导入,然后将其放在我正在处理的类的头文件中,但我收到了找不到RestKit的错误。

In the troubleshooting guide on RestKit's site it basically states to ensure the project is building in the derived data. 在RestKit网站上的故障排除指南中,它基本上声明要确保项目在派生数据中构建。 I checked and everything was ok. 我检查了,一切都很好。

I also tried deleting the derived data and cleaning the project without luck. 我也尝试删除派生数据并清理项目而没有运气。

Any ideas? 有任何想法吗?

Finally solved the issue. 终于解决了问题。

The problem was that cocoapods does not set the target configuration on multiple targets in a project. 问题是cocoapods不会在项目中的多个目标上设置目标配置。 I had my main target and a test target. 我有主要目标和测试目标。 Shame on me for doing unit tests. 为进行单元测试而感到羞耻。 :) :)

Pictures explains this best and I'd like to post a link to the original answer and give credit to that user who posted it. 图片提供了最好的解释,我想发布指向原始答案的链接,并感谢发布该答案的用户。 Thanks Waggles! 谢谢摇摆!

Solution at this link... 解决方案在此链接...

https://stackoverflow.com/a/16703468/1790578 https://stackoverflow.com/a/16703468/1790578

I hope this helps others in the future. 我希望这会在将来对其他人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM