当我将架构更新为 arm64 时,Restkit 失败

Restkit fails when I update architecture to arm64

当我将项目架构更新为 64 位时,出现了这些问题。我的部署目标是 7.1.

Undefined symbols for architecture x86_64: "OBJC_CLASS$RKClient", referenced from: objc-class-ref in AppDelegate.o objc-class-ref in SSRSuggestion.o "_OBJC_CLASS$RKObjectManager", referenced from: objc-class-ref in CinemaDetails-3BD8C6BC69EF1F23.o objc-class-ref in AppDelegate.o objc-class-ref in HomeScreen.o objc-class-ref in MovieDetails.o objc-class-ref in CinemaFilter-46E8309ACAC69139.o objc-class-ref in FilterView.o "_OBJC_CLASS$RKObjectMapping", referenced from: objc-class-ref in Cinema.o objc-class-ref in Movie.o objc-class-ref in Filter.o objc-class-ref in AppInfoModel.o "_OBJC_CLASS$RKParserRegistry", referenced from: objc-class-ref in SSRSuggestion.o "_OBJC_CLASS$RKRequestQueue", referenced from: objc-class-ref in CinemaDetails-3BD8C6BC69EF1F23.o objc-class-ref in AppDelegate.o objc-class-ref in MovieDetails.o "_OBJC_CLASS$_RKRequestSerialization", referenced from: objc-class-ref in SSRSuggestion.o "_RKMIMETypeJSON", referenced from: -[SSRSuggestion send_btn_pressed:] in SSRSuggestion.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

您的 RestKit 似乎是旧版本。最简单的方法可能是使用 CocoaPods。打开终端,输入:

$ sudo gem install cocoapods

然后在终端中转到您的项目文件夹并键入:

$ pod init

打开 .podfile 并插入此行:

pod 'RestKit', '~> 0.24'

保存并退出文件。在终端写:

$ pod install

从现在开始,您应该使用 .xcwrokspace 而不是 .xcproj。您还应该删除旧版本的 RestKit.


另一种选择是使用 git 子模块hg subrepos。我不会在这里输入教程,因为要写的太多了,cocoapods 对于新手来说更容易。


另一种选择是下载更新的 RestKit 版本并将其添加到您的项目中 "from hand" - 拖放。我 不推荐 这种方式,因为您永远不知道自己使用的是哪个版本,也看不到使用过的框架有新的更新(显然经常修复错误)。