你好,歡迎來到IOS教程網

 Ios教程網 >> IOS使用技巧 >> IOS技巧綜合 >> AFNetworking報錯_UTTypeCopyPreferredTagWithClass, referenced from: _AFContentTypeForPathExtens

AFNetworking報錯_UTTypeCopyPreferredTagWithClass, referenced from: _AFContentTypeForPathExtens

編輯:IOS技巧綜合
[摘要]本文是對AFNetworking報錯"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens的講解,對學習IOS蘋果軟件開發有所幫助,與大家分享。

問題: 在和Unity交互的過程中,從Unity開發工具打包出來的項目文件,在添加AFNetworking庫,運行時報出以下錯誤:

Undefined symbols for architecture armv7:

"_kUTTagClassMIMEType", referenced from:

-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o

"_kUTTagClassFilenameExtension", referenced from:

-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o

"_UTTypeCreatePreferredIdentifierForTag", referenced from:

-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o

"_UTTypeCopyPreferredTagWithClass", referenced from:

-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

原因是未添加 MobileCoreServices.framework(此框架定義統一類型標識符 (UTIs)使用的底層類型)

解決:Build Phase ->Link Binary With Libraries()下添加MobileCoreServices.framework。添加成功後運行程序成功。

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved