Originally created by @felipekoblinger on GitHub (Sep 20, 2018).
Hello! I'm not sure if I'm doing something wrong.
I'm using CoreStore (latest - 5.3.0) in a simple project and it was working fine on Xcode 9.4.1, but it is giving a runtime error in Xcode 10 (iOS 12).
❗ [CoreStore: Assertion Failure] Value.swift:140 value
↪︎ Attempted to access values from a 'MovieEntity' meta object. Meta objects are only used for querying keyPaths and infering types.
Originally created by @felipekoblinger on GitHub (Sep 20, 2018).
Hello! I'm not sure if I'm doing something wrong.
I'm using CoreStore (latest - 5.3.0) in a simple project and it was working fine on Xcode 9.4.1, but it is giving a runtime error in Xcode 10 (iOS 12).
```
❗ [CoreStore: Assertion Failure] Value.swift:140 value
↪︎ Attempted to access values from a 'MovieEntity' meta object. Meta objects are only used for querying keyPaths and infering types.
```
Code base: https://github.com/felipekoblinger/ibd185-my-watched-movies-ios
It is working fine in iOS 12 with Xcode 9.4.1.
Am I missing something?
Thanks :)
@felipekoblinger Hi, this was a known issue with Swift 4.2 and should be fixed in the develop branch for version 5.3.1. (I'm pushing the Cocoapods version within the day)
In this case the array returned from the friends relationship may be deallocated before the name property is read. You can fix this in the current 5.3.0 version by doing
In CoreStore 5.3.1 all CoreStoreObject property types now keep a strong reference to the internal NSManagedObject. In theory this shouldn't cause retain cycles because NSManagedObjects don't retain their parent CoreStoreObjects and their properties.
I'm keeping this issue open to get feedback from others. Let me know if you observe anything unstable.
@JohnEstropia commented on GitHub (Sep 21, 2018):
@felipekoblinger Hi, this was a known issue with Swift 4.2 and should be fixed in the `develop` branch for version 5.3.1. (I'm pushing the Cocoapods version within the day)
This is due to the [changes in memory ownership model](https://github.com/apple/swift/blob/master/docs/OwnershipManifesto.md) in Swift 4.2. In particular, in places where objects are chained:
```swift
let friendName = person.friends.value?.first?.name.value
```
In this case the array returned from the `friends` relationship may be deallocated before the `name` property is read. You can fix this in the current `5.3.0` version by doing
```swift
let friendName = withExtendedLifetime(person.friends.value) { $0?.first?.name.value }
```
In CoreStore 5.3.1 all CoreStoreObject property types now keep a strong reference to the internal `NSManagedObject`. In theory this shouldn't cause retain cycles because `NSManagedObject`s don't retain their parent `CoreStoreObject`s and their properties.
I'm keeping this issue open to get feedback from others. Let me know if you observe anything unstable.
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 @felipekoblinger on GitHub (Sep 20, 2018).
Hello! I'm not sure if I'm doing something wrong.
I'm using CoreStore (latest - 5.3.0) in a simple project and it was working fine on Xcode 9.4.1, but it is giving a runtime error in Xcode 10 (iOS 12).
Code base: https://github.com/felipekoblinger/ibd185-my-watched-movies-ios
It is working fine in iOS 12 with Xcode 9.4.1.
Am I missing something?
Thanks :)
@JohnEstropia commented on GitHub (Sep 21, 2018):
@felipekoblinger Hi, this was a known issue with Swift 4.2 and should be fixed in the
developbranch for version 5.3.1. (I'm pushing the Cocoapods version within the day)This is due to the changes in memory ownership model in Swift 4.2. In particular, in places where objects are chained:
In this case the array returned from the
friendsrelationship may be deallocated before thenameproperty is read. You can fix this in the current5.3.0version by doingIn CoreStore 5.3.1 all CoreStoreObject property types now keep a strong reference to the internal
NSManagedObject. In theory this shouldn't cause retain cycles becauseNSManagedObjects don't retain their parentCoreStoreObjects and their properties.I'm keeping this issue open to get feedback from others. Let me know if you observe anything unstable.