-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
"API Misuse" error during removePersistentStore: on macOS 11 #16
Comments
I have seen that error occur, but not recently, and I have been testing my apps, which are non-ARC, pretty much every day on Big Sur since June. I just retested some document closings now, with Beta 8. The line of code you mentioned executes with no errors. Are you seeing the errors with your app, or with BSTestApp? ARC or not? |
non-ARC, my own app. The "Mutating" error seems to crop up after releasing (deallocating) a managed object fetched from the store (my "Data Root" object) and then doing any kind of operation on the store, including processPendingChanges and removePersistentStore:. I'll need to do some more investigating on this end. I could have a logic error. Incidentally, one thread I saw said that their errors went away by migrating to NSPersistentContainer, introduced in 10.12. This might be an avenue for simplifying things in the future. |
Update: A second app of mine does not have this issue. After further investigation, I traced the problem to a key-value observer on the managed objects. Oddly, I was removing the observer prior to releasing the objects and prior to calling In any event, removing the KVO code altogether seems to have fixed the problem. KVO has caused nothing but problems in my code base so I will be happy to say good riddance to it. I'll leave this issue open for the rest of the day in case the error message crops up again. |
Okay, removing KVO fixed this error in a couple of different builds, so I will chalk it up to a Core Data Mystery and close the issue. |
When closing a document on Big Sur, I'm seeing the following errors:
The error occurs on this line:
BSManagedDocument/BSManagedDocument.m
Line 512 in bd11a8c
It is sometimes followed by a crash during dealloc but I need to investigate that some more. I don't see the errors on earlier operating systems.
The text was updated successfully, but these errors were encountered: