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?
Asked
Active
Viewed 1.1k times
28

Dan Levy
- 3,931
- 4
- 28
- 48
1 Answers
71
Figured the answer out on my own minutes later. Xcode decided to give me a did you mean
suggestion and .code
is now ._code
.

Dan Levy
- 3,931
- 4
- 28
- 48
-
4I think it's a bug. – Lumialxk Aug 12 '16 at 02:07
-
error?._code will be exactly correct and works for me...! – Abirami Bala Oct 05 '16 at 06:08
-
So strange naming convention. Thanks anyway. It works. – Bagusflyer Dec 02 '16 at 02:00