if (appCenterConfig[@"AppSecret"] != "APPCENTER_SECRET") {
[AppCenterReactNative register];
[AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true];
[AppCenterReactNativeCrashes registerWithAutomaticProcessing];
}
我收到以下錯誤:字串文字必須以'@'為前綴。
如何解決這個問題?我是一名 JS 開發人員,對 iOS 世界并不熟悉。我想@也應該在某個地方提供?
謝謝!
uj5u.com熱心網友回復:
字面量(包括 Objective-C 中的字串字面量)必須以 @ 為前綴,因為常規的“帶引號的字串”在 C 中已經表示其他含義,而 Objective-C 是 C 的超集。
"Thing in quotes"是一個 C 字串。
@"Thing in quotes"是一個 NSString 物件。
您不能將 NSStrings 與==or進行比較!=
用于[A isEqualToString:B]比較字串
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/513045.html
標籤:IOS目标-c
上一篇:如何從初級程式員變成高級程式員?
