The Core Data application I'm working on uses NSOperation and
NSOperationQueue for managing tasks. Since I don't want multiple
managed object contexts and all that entails, I handle the threading
issues by wrapping methods that require Core Data database access with
performSelectorOnMainThreadXXXXX.
I was getting a few nonrepeatable crashes indicating sqlite statements
being received out of sequence. I found and repaired a few Core Data-
base accesses that I had "missed", and now I'm not getting any more
crashes.
As I understand it, something as simple as getting a managed object's
attribute off the main thread can cause a crash, but not very often,
so I'm worried that I haven't found all of my threading design errors
yet.
Could I concoct some kind of test which would amplify these design
errors? For example, let's say I could grab the internal method which
Core Data uses to perform a query or something like that. I could
override this method and insert an assertion that currentThread ==
mainThread.
Any ideas how one might concoct such a test?
Sincerely,
Jerry Krinock
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]