/** * @since Available in iOS 3.0 and later. */ public static NSObject observeObjectsDidChange(NSManagedObject object, final VoidBlock3<NSManagedObject, NSManagedObjectContextNotification, NSNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ObjectsDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSManagedObjectContextNotification data = null; if (userInfo != null) { data = new NSManagedObjectContextNotification(userInfo); } block.invoke((NSManagedObject)a.getObject(), data, a); } }); }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeObjectsDidChange(NSManagedObject object, final VoidBlock3<NSManagedObject, NSManagedObjectContextNotification, NSNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ObjectsDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSManagedObjectContextNotification data = null; if (userInfo != null) { data = new NSManagedObjectContextNotification(userInfo); } block.invoke((NSManagedObject)a.getObject(), data, a); } }); }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeObjectsDidChange(NSManagedObject object, final VoidBlock3<NSManagedObject, NSManagedObjectContextNotification, NSNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ObjectsDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSManagedObjectContextNotification data = null; if (userInfo != null) { data = new NSManagedObjectContextNotification(userInfo); } block.invoke((NSManagedObject)a.getObject(), data, a); } }); }