views:

176

answers:

0

I have set up my project for using Google Toolbox for Mac as described on official wiki. And everything is working as expected.

For core data usage I have created a 'database' class that uses for final application SQLite storage (this is done based on Xcode template code).

For unit tests I have created separate init method for 'database' to use in memory storage (storage url is [NSURL URLWithString:@"memory://store"] and type NSInMemoryStoreType).

Without adding my model file (*.xcdatamodel) to unit tests target, test fail in expected place with message:

executeFetchRequest:error: A fetch request must have an entity.

If I add model file to the test target, then test is executed as expected (core data part looks OK), but after tests execution I get:

RunIPhoneUnitTest.sh: line 123:  9487 Segmentation fault      "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents
Command /bin/sh failed with exit code 139

This problem does not looks directly related to core data, but only happens if model file is added to target.

Any pointers on resolving this issue would be appreciated!

UPDATE After I have put the issue down here, I got really thinking and using Google correctly. Found answer on google groups.

Additional information about the problem - I loaded User entity from database that was put into autorelease pool. I did not retain it, but released. Correcting this error resolved my problem.

I wish I could get three days of my life back :)