Swift和objective-c名称在使用核心图形时发生冲突



使用Xcode 6.1时,我突然出现了这个错误。

/...-Bridging-Header.h:5:2: note: in module 'CoreGraphics' imported from /...-Bridging-Header.h:5:
@import CoreGraphics;
 ^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:271:1: error: definition with same mangled name as another definition CGPointMake(CGFloat x, CGFloat y)

它只发生在我从swift类调用CGPointMake时swift类使用一个objective-c类,该类在导入核心图形的桥接头中导入。

我已经清除了模块缓存和所有派生数据,并重新启动,只是为了更好地衡量。如果这不是模块缓存中的错误,并且核心图形函数在两个地方定义,我不知道如何解决它,除了"不要使用objective-c文件",这是我在处理它的同时所做的:/

不要在Swift:中使用CGPointMake

let point = CGPoint(x: 123, y: 456)

最新更新