出现以下错误:
no visible @interface for 'NSString' declares the selector 'primaryLanguage'
代码如下:
NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
```NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];```
答案 0 :(得分:1)
UIKeyboardInputMode
是私人课程。
因此,您不能调用此方法/属性。您必须add the private header,这使得无法在AppStore中发布代码。