我有以下代碼片段:
NSString* filt = [NSString stringWithUTF8String:allowedExtensions[i].c_str()];
UTType *type = [UTType typeWithIdentifier:filt];
我收到錯誤'Receiver 'UTType' for class message is a forward declaration'。如果我理解正確,這意味著未正確包含 UTType。我需要包含什么檔案才能正確宣告它?我正在使用可可。我可以通過 Google 找到關于此的零資訊。我正在使用 Xcode 13。我正在為 MacOS 開發。
這里列出的東西沒有幫助:receiver type *** for instance message is a forward Declaration
uj5u.com熱心網友回復:
UTType 來自UniformTypeIdentifiers 框架
@import UniformTypeIdentifiers;
或者
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
兩者是等價的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/399403.html
上一篇:如何在swiftiOS中使用swift高階函式從本地json創建ViewModel
下一篇:ios模擬器磁區問題
