-1
了以下錯誤:當我使用Xcode 7時,我得到了這個?有任何想法嗎?
no visible @interface for 'NSString' declares the selector 'primaryLanguage'
在下面的代碼:
NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
```NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];```
是你不允許使用它。你應該使用NSString * language = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];獲取用戶的主要語言爲您的應用程序。看到更多:http://stackoverflow.com/questions/3910244/getting-current-device-language-in-ios – BooRanger
感謝您的幫助! –