我正在构建一个简单的 iOS (Swift) 应用程序 - 它渲染 map 并在其上绘制标记。
当我的 Podfile 运行时,它工作正常
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
但是当我将其更改为这个(注意 use_frameworks!)
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!
pod 'GoogleMaps'
pod 'Alamofire', '~> 1.3'
我收到以下错误。
错误:
CoreData: warning: Unable to load class named 'GMSCachedObject' for entity 'GMSCachedObject'. Class not found, using default NSManagedObject instead.
2015-08-11 12:30:44.419 Closest[1784:15704] CoreData: warning: Unable to load class named 'GMSCachedTile' for entity 'GMSCachedTile'. Class not found, using default NSManagedObject instead.
2015-08-11 12:30:44.421 Closest[1784:15704] -[NSManagedObject tileCoords]: unrecognized selector sent to instance 0x7ff6d0cbf750
2015-08-11 12:30:44.450 Closest[1784:15704] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSManagedObject tileCoords]: unrecognized selector sent to instance 0x7ff6d0cbf750'
我应该做些什么不同的事情?
最佳答案
After some debugging I realised that the issue arose when attempting to use both ObjectiveC pods (such as GoogleMapsSDK) and Swift libraries such as Alamofire.
A really simple solution is to add -ObjC to your linkers in XCode which will tell it to compile the ObjectiveC pods.
After adding the linker everything compiles and I’m able to use the two pods in unison.
来源:http://luke-berry.co.uk/2015/08/19/google-maps-and-alamofire/
关于ios - 如何使用 use_frameworks cocoa pods 和 Google SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31935371/