I'm trying to set up a unit test to exercise parts of my iOS app's code, which 
includes Core Data code. The test case does not run with the app as Test Host. 
My test case copies the test data to a temporary directory, loads the Core Data 
stack using the test cases' class bundle and pointing to the sqlite file in the 
temporary test data directory, and begins work. The work is asynchronous, so 
the test case sets up an expectation and waits.

The code then does a fetch request to get a few "Job" entities, loops over them 
and processes each in turn. The problems is, sometimes, the reference to the 
Job is nil when it's finally worked on. It seems that the Jobs are being 
deallocated, despite being held. Here's the code:

        https://pastee.org/5j7hx

What bothers me is that the deletionQueue block has a reference to all the jobs 
in its local NSArray. But those job objects are being deallocated before it 
finishes. Any ideas? Thanks!

-- 
Rick Mann
[email protected]



_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to