/** * @since Available in iOS 4.0 and later. * @throws NSErrorException */ public void setResourceValue(NSURLVolumeProperty property, NSObject value) throws NSErrorException { NSError.NSErrorPtr err = new NSError.NSErrorPtr(); setResourceValue(value, property.value(), err); if (err.get() != null) { throw new NSErrorException(err.get()); } } /**
/** * @since Available in iOS 4.0 and later. * @throws NSErrorException */ public void setResourceValue(NSURLFileProperty property, NSObject value) throws NSErrorException { NSError.NSErrorPtr err = new NSError.NSErrorPtr(); setResourceValue(value, property.value(), err); if (err.get() != null) { throw new NSErrorException(err.get()); } } /**
/** * @since Available in iOS 4.0 and later. * @throws NSErrorException */ public void setResourceValue(NSURLFileSystemProperty property, NSObject value) throws NSErrorException { NSError.NSErrorPtr err = new NSError.NSErrorPtr(); setResourceValue(value, property.value(), err); if (err.get() != null) { throw new NSErrorException(err.get()); } } /**
public static NSURLProperty valueOf(NSString value) { NSURLProperty property = null; property = NSURLFileProperty.valueOf(value); if (property != null) return property; property = NSURLFileSystemProperty.valueOf(value); if (property != null) return property; property = NSURLVolumeProperty.valueOf(value); if (property != null) return property; property = NSURLUbiquitousItemProperty.valueOf(value); return property; } /*</methods>*/
public static NSObject observeDidChange(NSUserDefaults object, final VoidBlock1<NSUserDefaults> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((NSUserDefaults)a.getObject()); } }); } }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeWillRedoChange(NSUndoManager object, final VoidBlock1<NSUndoManager> block) { return NSNotificationCenter.getDefaultCenter().addObserver(WillRedoChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((NSUndoManager) a.getObject()); } }); } /**
/** * @since Available in iOS 8.2 and later. */ public static NSObject observeHostDidEnterBackground(NSExtensionContext object, final VoidBlock1<NSExtensionContext> block) { return NSNotificationCenter.getDefaultCenter().addObserver(HostDidEnterBackgroundNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((NSExtensionContext) a.getObject()); } }); } /**
/** * @since Available in iOS 8.2 and later. */ public static NSObject observeHostWillResignActive(NSExtensionContext object, final VoidBlock1<NSExtensionContext> block) { return NSNotificationCenter.getDefaultCenter().addObserver(HostWillResignActiveNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((NSExtensionContext) a.getObject()); } }); } /**
/** * @since Available in iOS 4.0 and later. */ public static NSFileHandle createForUpdating(NSURL url) throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); NSFileHandle result = createForUpdating(url, ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
/** * @since Available in iOS 9.0 and later. */ public static NSObject observePowerStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(PowerStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } }
public String scanUpToString(String string) { NSString.NSStringPtr ptr = new NSString.NSStringPtr(); if (!scanUpToString(string, ptr)) { return null; } return ptr.get().toString(); } public String scanUpToCharacters(NSCharacterSet set) {
public static NSObject observeChanged(NSURLCredentialStorage object, final VoidBlock1<NSURLCredentialStorage> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ChangedNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((NSURLCredentialStorage)a.getObject()); } }); } }
/** * @since Available in iOS 7.0 and later. */ public NSURLCredentialStorageRemovalOptions setShouldRemoveSynchronizableCredentials(boolean shouldRemoveSynchronizableCredentials) { set(Keys.RemoveSynchronizableCredentials(), NSNumber.valueOf(shouldRemoveSynchronizableCredentials)); return this; } /*</methods>*/