gpt4 book ai didi

ios - 如何使用 use_frameworks cocoa pods 和 Google SDK

转载 作者:可可西里 更新时间:2023-11-01 01:39:19 26 4
gpt4 key购买 nike

我正在构建一个简单的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com