Unknown type name 'CGVector'; did you mean 'CIVector'?

◇◆丶佛笑我妖孽 提交于 2019-12-13 08:13:25

问题


I am working in a project i started in the last Xcode 4 version and when i open and try tu run it using the new Xcode 5 i get this error in both UIPushBehavior.h and UIGravityBehavior.h.

/Applications/xcode 4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h:34:34: Unknown type name 'CGVector'; did you mean 'CIVector'?

and does not compile my project.

Any ideas on how to fix this will be greatly appreciated.


回答1:


Well i fix the error.The problem relied on the Header Search Paths and the Library Search Path both were pointing to the project directories so the UIKit the project was using was an old one.

In my case i fix the problem by changing the Header Search Path to : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/include.

and leaving the Library search path pointing to my project folder:

$(SRCROOT)/project_name

Tricky one since it compiled in any version prior to XCode 5 5A1413.

Hope this helps to anyone else.




回答2:


CGVector is part of CGGeometry.

To fix your problem, make certain the ApplicationServices framework is included in your project and also "#import <CoreGraphics/CGGeometry.h>" at the top of your .m file.

Oh, looking closely at the documentation, I see CGVector was made available as of iOS 7 and later. This means you might have a conflicting type in your project if something else was defining it prior to you using Xcode 5.



来源:https://stackoverflow.com/questions/19071014/unknown-type-name-cgvector-did-you-mean-civector

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!