mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
context.parentStack == nil #238
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
6859babd5c/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:
c413290adc/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
