我在使用 Xcode 7 时得到了这个?有任何想法吗?

I got this when I use Xcode 7? any ideas?

出现以下错误:

 no visible @interface for 'NSString' declares the selector 'primaryLanguage'

在以下代码中:

 NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
```NSString *lang = [[[UITextInputMode activeInputModes] firstObject] primaryLanguage];```

UIKeyboardInputMode 是私有 class.

因此,您不能调用此 method/property。您将不得不 add the private header,这使得无法在 AppStore 中发布代码。