/** * @since Available in iOS 7.0 and later. */ public static NSObject observeStoresWillChange(NSPersistentStoreCoordinator object, final VoidBlock2<NSPersistentStoreCoordinator, NSPersistentStoreCoordinatorChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(StoresWillChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSPersistentStoreCoordinatorChangeNotification data = null; if (userInfo != null) { data = new NSPersistentStoreCoordinatorChangeNotification(userInfo); } block.invoke((NSPersistentStoreCoordinator)a.getObject(), data); } }); } /**
/** * @since Available in iOS 7.0 and later. */ public static NSObject observeStoresWillChange(NSPersistentStoreCoordinator object, final VoidBlock2<NSPersistentStoreCoordinator, NSPersistentStoreCoordinatorChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(StoresWillChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSPersistentStoreCoordinatorChangeNotification data = null; if (userInfo != null) { data = new NSPersistentStoreCoordinatorChangeNotification(userInfo); } block.invoke((NSPersistentStoreCoordinator)a.getObject(), data); } }); } /**
/** * @since Available in iOS 7.0 and later. */ public static NSObject observeStoresWillChange(NSPersistentStoreCoordinator object, final VoidBlock2<NSPersistentStoreCoordinator, NSPersistentStoreCoordinatorChangeNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(StoresWillChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); NSPersistentStoreCoordinatorChangeNotification data = null; if (userInfo != null) { data = new NSPersistentStoreCoordinatorChangeNotification(userInfo); } block.invoke((NSPersistentStoreCoordinator)a.getObject(), data); } }); } /**