Originally created by @dufflink on GitHub (Oct 26, 2018).
Hi.
I found that in some cases in row fetchRequest.entity = context.parentStack!.entityDescription(for: EntityIdentifier(self.entityClass))!
context.parentStack can be nil. But i dont understand why?
Can you help me?
This From.swift : 144
Originally created by @dufflink on GitHub (Oct 26, 2018).
Hi.
I found that in some cases in row
`fetchRequest.entity = context.parentStack!.entityDescription(for: EntityIdentifier(self.entityClass))!`
context.parentStack can be nil. But i dont understand why?
Can you help me?
This From.swift : 144
This may also happen if the DataStack is deallocated before the objects are accessed. Is your DataStack properly retained somewhere?
@JohnEstropia commented on GitHub (Nov 3, 2018):
This may also happen if the `DataStack` is deallocated before the objects are accessed. Is your `DataStack` properly retained somewhere?
Null pointer dereference is reproduced when fetching Dynamic Object from DataStack set up for managed model (NSManagedObject).
@evkalinin commented on GitHub (Nov 27, 2018):
Null pointer dereference is reproduced when fetching Dynamic Object from DataStack set up for managed model (NSManagedObject).
@MaxPaymon Is your case just as @clouddevil stated above? If so then this is by design and I'd close this issue
@JohnEstropia commented on GitHub (Nov 28, 2018):
@MaxPaymon Is your case just as @clouddevil stated above? If so then this is by design and I'd close this issue
Null pointer dereference is reproduced when fetching Dynamic Object from DataStack set up for managed model (NSManagedObject).
Hi!. Do not quite understand what to do in this case.
@dufflink commented on GitHub (Nov 28, 2018):
> Null pointer dereference is reproduced when fetching Dynamic Object from DataStack set up for managed model (NSManagedObject).
Hi!. Do not quite understand what to do in this case.
This may also happen if the DataStack is deallocated before the objects are accessed. Is your DataStack properly retained somewhere?
I call Data Stack initialization when user is authorized. I do this so that each user has his own database
@dufflink commented on GitHub (Nov 28, 2018):
> This may also happen if the `DataStack` is deallocated before the objects are accessed. Is your `DataStack` properly retained somewhere?
I call Data Stack initialization when user is authorized. I do this so that each user has his own database
<img width="798" alt="2018-11-28 14 57 27" src="https://user-images.githubusercontent.com/29461219/49144003-19125380-f31e-11e8-91f2-ec1a9b03af8c.png">
@evkalinin commented on GitHub (Nov 28, 2018):
I have the same error when fetch DO object. Sample:
https://github.com/clouddevil/CoreStore/blob/6859babd5c63b5dcd9d18034291d174db681c105/CoreStoreTests/IssueTests.swift#L60
i close https://github.com/JohnEstropia/CoreStore/issues/290, @JohnEstropia thank you
I get it what you mean, but I am faced with the problem of implementation
@dufflink commented on GitHub (Nov 28, 2018):
I get it what you mean, but I am faced with the problem of implementation
<img width="883" alt="2018-11-28 17 40 47" src="https://user-images.githubusercontent.com/29461219/49152501-db6cf500-f334-11e8-82a1-b4051b88ad76.png">
I am sure, It will be easier to answer, if you show the code sample how storage is being used in your app.
@evkalinin commented on GitHub (Nov 28, 2018):
I am sure, It will be easier to answer, if you show the code sample how storage is being used in your app.
@MaxPaymon In your CacheManager class, you need to retain a strong reference to the DataStack, not the LocalStorage
@JohnEstropia commented on GitHub (Nov 29, 2018):
@MaxPaymon In your `CacheManager` class, you need to retain a strong reference to the `DataStack`, not the `LocalStorage`
Some another question:
If has only one "Default" configuration, it must be set to nil ?
How to link application with CoreStore as static library? (without use_frameworks! in pod)
@evkalinin commented on GitHub (Nov 29, 2018):
I try to reproduce the issue, and might be wrong.
See:
https://github.com/clouddevil/CoreStore/blob/c413290adca898891c89bd445d9665d29a6a581d/CoreStoreTests/IssueTests.swift#L86
Is fetched object from different object model?
Some another question:
If has only one "Default" configuration, it must be set to nil ?
How to link application with CoreStore as static library? (without use_frameworks! in pod)
I just need to create a separate database for each user
The application throws an error when I initialize the Storage with another name.
@dufflink commented on GitHub (Nov 29, 2018):
I just need to create a separate database for each user
The application throws an error when I initialize the Storage with another name.
If you require a separate store for each user, don't use CoreStore.defaultStack.
In your CacheManager, replace
privatevarstorage:LocalStorage?
with
privatevardataStack:DataStack?
and assign your DataStack there.
I'm closing this ticket as it seems to be an app-specific implementation issue. I would encourage for you to understand the relationships between DataStacks and LocalStorages, see https://github.com/JohnEstropia/CoreStore#architecture )
@JohnEstropia commented on GitHub (Dec 5, 2018):
If you require a separate store for each user, don't use `CoreStore.defaultStack`.
In your `CacheManager`, replace
```swift
private var storage: LocalStorage?
```
with
```swift
private var dataStack: DataStack?
```
and assign your `DataStack` there.
I'm closing this ticket as it seems to be an app-specific implementation issue. I would encourage for you to understand the relationships between DataStacks and LocalStorages, see https://github.com/JohnEstropia/CoreStore#architecture )
Здравствуйте! Я сделал, как вы советовали, но проблема осталось такой же.
The initDB function is called every time I log in as a user.
The error occurs only when I log out from the account of one user and immediately try to log in to another user.
The place where the error most likely occurs
@dufflink commented on GitHub (Jan 10, 2019):
Здравствуйте! Я сделал, как вы советовали, но проблема осталось такой же.
<img width="1072" alt="2019-01-10 11 46 15" src="https://user-images.githubusercontent.com/29461219/50951315-8218e980-14ce-11e9-8596-5aaa67972e91.png">
The initDB function is called every time I log in as a user.
The error occurs only when I log out from the account of one user and immediately try to log in to another user.
The place where the error most likely occurs
<img width="462" alt="2019-01-10 11 52 02" src="https://user-images.githubusercontent.com/29461219/50951405-e3d95380-14ce-11e9-94c9-b71e170c2b10.png">
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 @dufflink on GitHub (Oct 26, 2018).
Hi.
I found that in some cases in row
fetchRequest.entity = context.parentStack!.entityDescription(for: EntityIdentifier(self.entityClass))!context.parentStack can be nil. But i dont understand why?
Can you help me?
This From.swift : 144
@dufflink commented on GitHub (Oct 29, 2018):
@dufflink commented on GitHub (Nov 2, 2018):
Please! Help me!
@JohnEstropia commented on GitHub (Nov 3, 2018):
@MaxPaymon Hi, can you show the code how it's being used in your app?
@JohnEstropia commented on GitHub (Nov 3, 2018):
This may also happen if the
DataStackis deallocated before the objects are accessed. Is yourDataStackproperly retained somewhere?@evkalinin commented on GitHub (Nov 27, 2018):
Null pointer dereference is reproduced when fetching Dynamic Object from DataStack set up for managed model (NSManagedObject).
@JohnEstropia commented on GitHub (Nov 28, 2018):
@MaxPaymon Is your case just as @clouddevil stated above? If so then this is by design and I'd close this issue
@dufflink commented on GitHub (Nov 28, 2018):
Hi!. Do not quite understand what to do in this case.
@dufflink commented on GitHub (Nov 28, 2018):
I call Data Stack initialization when user is authorized. I do this so that each user has his own database
@evkalinin commented on GitHub (Nov 28, 2018):
I have the same error when fetch DO object. Sample:
https://github.com/clouddevil/CoreStore/blob/6859babd5c63b5dcd9d18034291d174db681c105/CoreStoreTests/IssueTests.swift#L60
i close https://github.com/JohnEstropia/CoreStore/issues/290, @JohnEstropia thank you
@dufflink commented on GitHub (Nov 28, 2018):
I get it what you mean, but I am faced with the problem of implementation

@evkalinin commented on GitHub (Nov 28, 2018):
I am sure, It will be easier to answer, if you show the code sample how storage is being used in your app.
@dufflink commented on GitHub (Nov 28, 2018):
@JohnEstropia commented on GitHub (Nov 29, 2018):
@MaxPaymon In your
CacheManagerclass, you need to retain a strong reference to theDataStack, not theLocalStorage@dufflink commented on GitHub (Nov 29, 2018):
How can i do it?
@evkalinin commented on GitHub (Nov 29, 2018):
I try to reproduce the issue, and might be wrong.
See:
https://github.com/clouddevil/CoreStore/blob/c413290adca898891c89bd445d9665d29a6a581d/CoreStoreTests/IssueTests.swift#L86
Is fetched object from different object model?
Some another question:
If has only one "Default" configuration, it must be set to nil ?
How to link application with CoreStore as static library? (without use_frameworks! in pod)
@dufflink commented on GitHub (Nov 29, 2018):
I just need to create a separate database for each user
The application throws an error when I initialize the Storage with another name.
@evkalinin commented on GitHub (Nov 29, 2018):
CoreStore.defaultStack is singleton. Did you rewrite stack with last one?
@dufflink commented on GitHub (Nov 29, 2018):
Yes
@JohnEstropia commented on GitHub (Dec 5, 2018):
If you require a separate store for each user, don't use
CoreStore.defaultStack.In your
CacheManager, replacewith
and assign your
DataStackthere.I'm closing this ticket as it seems to be an app-specific implementation issue. I would encourage for you to understand the relationships between DataStacks and LocalStorages, see https://github.com/JohnEstropia/CoreStore#architecture )
@dufflink commented on GitHub (Jan 10, 2019):
Здравствуйте! Я сделал, как вы советовали, но проблема осталось такой же.

The initDB function is called every time I log in as a user.
The error occurs only when I log out from the account of one user and immediately try to log in to another user.
The place where the error most likely occurs
