Originally created by @laeroah on GitHub (Aug 23, 2017).
NSManagedObjectModel constructor convenience init?(contentsOf url: URL) returns an optional value but the function is expecting a nonoptional value.
It seems that Xcode9 beta5 wasn't picking up this error for some reason. Xcode8 compiler will complain as expected.
Looks like the old version had the unwrapping, but was removed in new version:
public func rawModel() -> NSManagedObjectModel {
if let cachedRawModel = self.cachedRawModel {
return cachedRawModel
}
if let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL) {
self.cachedRawModel = rawModel
return rawModel
}
CoreStore.abort("Could not create an \(cs_typeName(NSManagedObjectModel.self)) from the model at URL \"\(self.modelVersionFileURL)\".")
}
Originally created by @laeroah on GitHub (Aug 23, 2017).
<img width="1247" alt="screen shot 2017-08-23 at 3 05 28 pm" src="https://user-images.githubusercontent.com/1928509/29634088-a12b9408-8816-11e7-8567-17850c141a99.png">
`NSManagedObjectModel` constructor `convenience init?(contentsOf url: URL)` returns an optional value but the function is expecting a nonoptional value.
It seems that Xcode9 beta5 wasn't picking up this error for some reason. Xcode8 compiler will complain as expected.
Looks like the old version had the unwrapping, but was removed in new version:
```
public func rawModel() -> NSManagedObjectModel {
if let cachedRawModel = self.cachedRawModel {
return cachedRawModel
}
if let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL) {
self.cachedRawModel = rawModel
return rawModel
}
CoreStore.abort("Could not create an \(cs_typeName(NSManagedObjectModel.self)) from the model at URL \"\(self.modelVersionFileURL)\".")
}
```
Ah, I fixed this in the Swift 4 branch completely misunderstanding this was a Swift 4 change and not an iOS 11 change. Sorry about that. Will push the fix for the 3.2 branch as well.
@JohnEstropia commented on GitHub (Aug 24, 2017):
Ah, I fixed this in the Swift 4 branch completely misunderstanding this was a Swift 4 change and not an iOS 11 change. Sorry about that. Will push the fix for the 3.2 branch as well.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @laeroah on GitHub (Aug 23, 2017).
NSManagedObjectModelconstructorconvenience init?(contentsOf url: URL)returns an optional value but the function is expecting a nonoptional value.It seems that Xcode9 beta5 wasn't picking up this error for some reason. Xcode8 compiler will complain as expected.
Looks like the old version had the unwrapping, but was removed in new version:
@JohnEstropia commented on GitHub (Aug 24, 2017):
Ah, I fixed this in the Swift 4 branch completely misunderstanding this was a Swift 4 change and not an iOS 11 change. Sorry about that. Will push the fix for the 3.2 branch as well.
@laeroah commented on GitHub (Aug 24, 2017):
Thanks!
@JohnEstropia commented on GitHub (Aug 24, 2017):
Fixed in the
prototype/Swift_3_2branch as well. Thanks!