views:

41

answers:

0

I have implemented thread-targeted notifications as per the Apple document "Delivering Notifications To Particular Threads" (http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html#//apple_ref/doc/uid/20001289-CEGJFDFG) in my app, and it works great when run in the Simulator (iPhone 4 / iOS 4.1 BaseSDK and Target).

However, when I run the app directly on my iPhone 4 (Device / iOS 4.1 BaseSDK, Target / Debug) I get this exception: "sendBeforeDate:components:from:reserved: only defined for abstract class. Define -[NSMachPort sendBeforeDate:components:from:reserved:]".

The reason for the thread-targeted notifications is to be able to call mergeChangesFromContextDidSaveNotification on the main thread's ManagedObjectContext with the NSManagedObjectContextDidSaveNotification notification posted by a separate ManagedObjectContext instance running in a separate thread.

Why would this be working in Simulator, but not on device? Is there a cleaner approach for merging changes from a background thread's ManagedObjectContext with the main thread's instance?