Value of type 'Error' has no member 'code' [duplicate]

喜夏-厌秋 提交于 2019-12-05 09:45:45

问题


I am moving a test application over to Xcode 8 Beta 5 and converted my code to Swift 3. I am left with a few errors regarding the switch to Error from NSError. I get an error in Xcode saying, 'Value of type 'Error' has no member 'code'. I can still use localizedDescription. Is code no longer a value within Error or is it just a bug within Xcode?


回答1:


Figured the answer out on my own minutes later. Xcode decided to give me a did you mean suggestion and .code is now ._code.



来源:https://stackoverflow.com/questions/38908667/value-of-type-error-has-no-member-code

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