添加框架后Xcode 5.1编译器错误 [英] Xcode 5.1 compiler errors after adding a framework

查看:248
本文介绍了添加框架后Xcode 5.1编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是新的Xcode和Macs,我似乎在尝试添加一个新的框架后得到了很多错误。我需要NSMatrix类,它不包括在默认框架(Foundation,CoreGraphics,UIKit,XCTest。所以我添加了AppKit框架使用项目导航>通用>链接框架和库在我添加和#imported Appkit / AppKit.h在需要NSMatrix类的.h中,NSMatrix的错误消失了,它变成了蓝色,表示它发现它是我假设的。

So I am new to Xcode and Macs and I seem to be getting a lot of errors after trying to add a new framework. I needed the NSMatrix class and it was not included in the default frameworks (Foundation, CoreGraphics, UIKit, XCTest were. So I added the AppKit framework using Project Navigator>General>Linked Frameworks and Libraries. After I added that and #imported Appkit/AppKit.h in the .h that needed the NSMatrix class the errors for NSMatrix went away and it turned blue. Indicating that it found it I assume.

编译项目并遇到以下错误:

After that I tried compiling the project and got these errors:

http://i1346.photobucket.com/albums/p694/parkertmorris/ScreenShot2014-04-07at42152PM_zps3a1fdfdd.png

我尝试删除AppKit框架和对它的引用和编译,但我仍然得到这些错误。我也尝试清理项目和删除DerivedData文件夹,但没有什么改变。

I tried removing the AppKit framework and the reference to it and compiling but I still get these errors. I also tried cleaning the project and deleting the DerivedData folder but nothing is changing.

任何想法如何我可以解决这个?试图研究此问题至少一个小时。

Any ideas how I can fix this? Tried to research this problem for at least an hour.

感谢

推荐答案

p>您和我都是新用户(虽然我是很长时间的读者),因此我会尽我所能帮助:)

You and I are both new users (although I am a long time reader) to SO, and as such I'll try my best to help :)

我注意到您在iOS下对此进行了标记。 AppKit和NSMatrix是特定于OS X的,不适用于iOS,您可能想要删除iOS标记,并相应地标记问题。

I noticed you tagged this under "iOS". AppKit and NSMatrix are OS X specific, not for iOS, and you may want to remove the iOS tag as such and tag the question appropriately.

当这样的问题发生时我在XCode,它发生不太频繁的经验,但仍然在恼人的时间间隔,我倾向于使用Git(或任何SCM你喜欢)倒退到一个点,其中事情是最少的混乱。基于你的编译器错误仍然发生没有AppKit / NSMatrix引用的事实,你的问题可能存在独立的框架,或至少在框架旁边。

When problems like this happen to me in XCode, which occur less frequently with experience but still at annoying intervals, I tend to step backwards using Git (or whatever SCM you like) to a point where things are the least messed up. Based on the fact that your compiler errors are still occurring without AppKit/NSMatrix references, your problem likely exists independent of the framework, or at least alongside the framework.

尝试在项目包中打开project.pbxproj文件,并在同一分组下查找.h文件的重复条目。这些类型的问题有时会咬我,当重新基础/合并在Git和90%的时间,我可以修复他们对我的project.pbxproj文件的一个非常简单的更改。更好的是,尝试diff它以前的工作.pbxproj与它的当前状态,看看发生了什么。

Try opening your project.pbxproj file inside your project package and looking for duplicate entries of .h files under the same groupings. These types of problems sometimes bite me when rebasing/merging in Git and 90% of the time I can fix them with a very simple change to my project.pbxproj file. Even better, try diffing your previously working .pbxproj with it's current state and see what's going on.

这篇关于添加框架后Xcode 5.1编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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