public static String getLocalizedString(String key) { return NSBundle.getMainBundle().getLocalizedString(key, "", null); }
/** * @since Available in iOS 4.0 and later. */ public NSBundle(NSURL url) { super((SkipInit) null); initObject(init(url)); } /*</constructors>*/
@SuppressWarnings("unchecked") @Override public void invoke(NSNotification a) { List<String> classes = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(LoadedClassesKey())) { NSArray<NSString> val = (NSArray<NSString>)data.get(LoadedClassesKey()); classes = val.asStringList(); } block.invoke((NSBundle)a.getObject(), classes); } });
/** * @since Available in iOS 2.0 and later. */ public boolean load() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); boolean result = load(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
/** * @since Available in iOS 2.0 and later. */ public boolean preflight() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); boolean result = preflight(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
public static NSObject observeDidLoad(NSBundle object, final VoidBlock2<NSBundle, List<String>> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidLoadNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @SuppressWarnings("unchecked") @Override public void invoke(NSNotification a) { List<String> classes = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(LoadedClassesKey())) { NSArray<NSString> val = (NSArray<NSString>)data.get(LoadedClassesKey()); classes = val.asStringList(); } block.invoke((NSBundle)a.getObject(), classes); } }); } }
@SuppressWarnings("unchecked") @Override public void invoke(NSNotification a) { List<String> classes = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(LoadedClassesKey())) { NSArray<NSString> val = (NSArray<NSString>)data.get(LoadedClassesKey()); classes = val.asStringList(); } block.invoke((NSBundle)a.getObject(), classes); } });
/** * @since Available in iOS 2.0 and later. */ public boolean load() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); boolean result = load(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
/** * @since Available in iOS 2.0 and later. */ public boolean preflight() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); boolean result = preflight(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
public static NSObject observeDidLoad(NSBundle object, final VoidBlock2<NSBundle, List<String>> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidLoadNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @SuppressWarnings("unchecked") @Override public void invoke(NSNotification a) { List<String> classes = null; NSDictionary<?, ?> data = a.getUserInfo(); if (data.containsKey(LoadedClassesKey())) { NSArray<NSString> val = (NSArray<NSString>)data.get(LoadedClassesKey()); classes = val.asStringList(); } block.invoke((NSBundle)a.getObject(), classes); } }); } }
/** * @since Available in iOS 4.0 and later. */ public NSBundle(NSURL url) { super((SkipInit) null); initObject(init(url)); } /*</constructors>*/
public static String getLocalizedString(String key) { return NSBundle.getMainBundle().getLocalizedString(key, "", null); }
public NSBundle(File file) { super((SkipInit) null); initObject(init(file.getAbsolutePath())); }
public NSBundle(File file) { super((SkipInit) null); initObject(init(file.getAbsolutePath())); }