NSError localizedDescription always returns english error message

时光怂恿深爱的人放手 提交于 2020-01-14 07:55:29

问题


Why does an NSError * error object with NSURLErrorDomain always return the error.localizedDescription in english ?


回答1:


The answer to this question can be found in the project settings. You have to add the language you are interested in to your project Settings:

  • Select the Project in the left navigate
  • select the project (not the target)
  • select the "Info" pane
  • add the language to the "localization" section



回答2:


Language is the first available in your project according to your languages order in the settings




回答3:


In your "iOS Simulator" (or in your testing device) start "Settings" app and select the required testing language. Start your app again and you will get the correct localised Description.



来源:https://stackoverflow.com/questions/21733837/nserror-localizeddescription-always-returns-english-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!