Humble Objective-Cer
Humble Objective-Cer

Reputation: 123

executeFetchRequest exits current method

I'm experiencing a strange problem with Core Data. Target is iOS 5.0

This line of code:

   NSArray *results = [self executeFetchRequest:request error:&error];

exits the current method. No code is executed after that line. The app doesn't crash. No exceptions are thrown. This happens occasionally, not every time.

As I step through code and hit that line, it just returns from the current method.

Any hints, clues, etc?

Thank you for your time.

Upvotes: 0

Views: 119

Answers (1)

Leonardo
Leonardo

Reputation: 9857

As stated in comment, the fetch is probably executed on a separate thread. That explains why the app doesn't crash.

Without seeing the code, the crash maybe caused by a wrong fetch request, probably in its syntax.

Try to put a breakpoint and at least print the statement, for example with po request in the console, or NSLog(yourStatament) you should be able to see the whole statement. Have a look if something in there is nil.

Also, I see you are using self in your execute fetch. If this is a separate thread I would probably take a strong reference to self to let the main thread release resources. But this just a guess.

Upvotes: 1

Related Questions