Last active
May 16, 2016 03:11
-
-
Save pouriaalmassi/90d62bec751bdb3d61a93a7c46744ce7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swift 2.2 | |
// Xcode Version 7.3 (7D175) | |
// 1 | |
do { | |
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil) | |
} catch { | |
var dict = [String: AnyObject]() | |
// Build warning: | |
// Forced cast from 'ErrorType' to 'NSError' always succeeds; did you mean to use 'as'? | |
dict[NSUnderlyingErrorKey] = error as! NSError | |
let wrappedError = NSError(domain: "error-domain", code: 0001, userInfo: dict) | |
} | |
// 2 | |
do { | |
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil) | |
} catch { | |
var dict = [String: AnyObject]() | |
// Build error: | |
// 'ErrorType' is not convertible to 'NSError'; did you mean to use 'as!' to force downcast? | |
dict[NSUnderlyingErrorKey] = error as NSError | |
let wrappedError = NSError(domain: "error-domain", code: 0001, userInfo: dict) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, I run into this problem yesterday, but I cannot resolve it. I reinstall my Xcode, but with no lucky. Did you find out why?