views:

547

answers:

2

I've got 2 applications using Core Data with a sqlite persistent store. I've got a data loader routine that I run to populate the CoreData DB from csv files. During development, when my data changes I run the routine from the simulator to generate new databases and copy the new one into the project.

This has been working quite well for XCode 3.2.3 and iOS 4.0. It even works in the XCode 4 Preview 2 and 3. I just installed the final version of XCode 3.2.4 and iOS 4.1. Now my db loader fails. It gives me no message, no warning, no nothing. It just dumps out to the spring board and XCode gives me the "Debugging Terminated" message. It will fail at different times during the load so I'm pretty sure it's not a data issue. I'm not doing any threading. I assume the issue has to do with either Core Data or sqlite, since that's when the crash occurs, but with no info reported I can't tell for sure.

I uninstalled everything. Xcode 3.2.4, Xcode 4 preview (assuming it was an issue caused by XCode 4) and reinstalled XCode 3.2.3/iOS 4.0. Things returned to normal. After getting some work done I attempted to upgrade to 3.2.4/iOS 4.1 again. I uninstalled 3.2.3/iOS 4.0, rebooted. Installed 3.2.4/iOS 4.1, rebooted and tried again. No luck. Same hard crash. Same lack of messaging as to the cause.

I have determined that this only happens with the Simulator with XCode 3.2.4, the device is fine as is XCode 4 and 3.2.3. I've tried playing with the target OS selection (3.0,3.1,4.0,4.1). I've tired adjusting the Compiler from GCC 4.0, GCC 4.2,LLVM GCC 4.2, LLVM 1.5. I've tried setting the Base SDK to iOS Simulator 4.1. Interestingly enough it will work in the iPad simulator when using the 3.2 SDK. So I've at least go that as a work around.

I guess there is one of 3 issues:

  1. An issue with my code that has been uncovered by 3.2.4.

  2. Bug in 3.2.4.

  3. A configuration issue that I've missed.

If anybody has any troubleshooting ideas or answers I'd love to hear them. I've been doing iOS full time since V 2.1 and I am seriously stumped.

Thanks in advance,

A: 

When I upgraded I ran into troubles in the simulator when saving the managedObjectContext. I finally deleted my sqlite CoreData store file and have not run into similar problems. Try deleting your data file (well save a copy of it before deleting to see what is different).

Brent Priddy
A good tip when troubleshooting core data issues. That's one of the first things I try when dealing with Core Data oddness.
TheGeoff
A: 

I figured out my issue. It looks like the CoreData/Sqlite connection was a total red herring. Following a tip I read on SO, I used OSX's Console application and got a critical message "Failed to launch in time" that was not being displayed in XCode's debugger console.

It looks like the process was being killed due to what is essentially a timeout error. The iPhone will kill an application that takes too long to complete "didFinishLaunching." That's where I was kicking the data load routine off from. The new version of XCode must have adjusted it's timeout values.

So my takeaway is give OSX's console a shot if XCode isn't telling you everything and watch out for those red herrings.

TheGeoff