Class NSBundle

  • All Implemented Interfaces:
    NSObject

    public class NSBundle
    extends NSObject
    Because NSBundle caches allocated instances, subclasses should be prepared to receive an already initialized object back from [super initWithPath:]
    • Constructor Detail

      • NSBundle

        protected NSBundle​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • URLForResourceWithExtensionSubdirectoryInBundleWithURL

        @Nullable
        public static @Nullable NSURL URLForResourceWithExtensionSubdirectoryInBundleWithURL​(@Nullable
                                                                                             @Nullable java.lang.String name,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String ext,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String subpath,
                                                                                             @NotNull
                                                                                             @NotNull NSURL bundleURL)
        Methods for locating bundle resources. Instance methods locate resources in the bundle indicated by the receiver; class methods take an argument pointing to a bundle on disk. In the class methods, bundleURL is a URL pointing to the location of a bundle on disk, and may not be nil; bundlePath is the path equivalent of bundleURL, an absolute path pointing to the location of a bundle on disk. By contrast, subpath is a relative path to a subdirectory inside the relevant global or localized resource directory, and should be nil if the resource file in question is not in a subdirectory. Where appropriate, localizationName is the name of a .lproj directory in the bundle, minus the .lproj extension; passing nil for localizationName retrieves only global resources, whereas using a method without this argument retrieves both global and localized resources (using the standard localization search algorithm). API-Since: 4.0
      • URLsForResourcesWithExtensionSubdirectoryInBundleWithURL

        @Nullable
        public static @Nullable NSArray<? extends NSURL> URLsForResourcesWithExtensionSubdirectoryInBundleWithURL​(@Nullable
                                                                                                                  @Nullable java.lang.String ext,
                                                                                                                  @Nullable
                                                                                                                  @Nullable java.lang.String subpath,
                                                                                                                  @NotNull
                                                                                                                  @NotNull NSURL bundleURL)
        API-Since: 4.0
      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allBundles

        @NotNull
        public static @NotNull NSArray<? extends NSBundle> allBundles()
      • allFrameworks

        @NotNull
        public static @NotNull NSArray<? extends NSBundle> allFrameworks()
      • alloc

        public static NSBundle alloc()
      • allocWithZone

        public static NSBundle allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • bundleForClass

        @NotNull
        public static @NotNull NSBundle bundleForClass​(@NotNull
                                                       @NotNull org.moe.natj.objc.Class aClass)
      • bundleWithIdentifier

        @Nullable
        public static @Nullable NSBundle bundleWithIdentifier​(@NotNull
                                                              @NotNull java.lang.String identifier)
      • bundleWithPath

        public static NSBundle bundleWithPath​(@NotNull
                                              @NotNull java.lang.String path)
      • bundleWithURL

        public static NSBundle bundleWithURL​(@NotNull
                                             @NotNull NSURL url)
        API-Since: 4.0
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • mainBundle

        @NotNull
        public static @NotNull NSBundle mainBundle()
        Methods for creating or retrieving bundle instances.
      • new_objc

        public static NSBundle new_objc()
      • pathForResourceOfTypeInDirectory_static

        @Nullable
        public static @Nullable java.lang.String pathForResourceOfTypeInDirectory_static​(@Nullable
                                                                                         @Nullable java.lang.String name,
                                                                                         @Nullable
                                                                                         @Nullable java.lang.String ext,
                                                                                         @NotNull
                                                                                         @NotNull java.lang.String bundlePath)
      • pathsForResourcesOfTypeInDirectory_static

        @NotNull
        public static @NotNull NSArray<java.lang.String> pathsForResourcesOfTypeInDirectory_static​(@Nullable
                                                                                                   @Nullable java.lang.String ext,
                                                                                                   @NotNull
                                                                                                   @NotNull java.lang.String bundlePath)
      • preferredLocalizationsFromArray

        @NotNull
        public static @NotNull NSArray<java.lang.String> preferredLocalizationsFromArray​(@NotNull
                                                                                         @NotNull NSArray<java.lang.String> localizationsArray)
      • preferredLocalizationsFromArrayForPreferences

        @NotNull
        public static @NotNull NSArray<java.lang.String> preferredLocalizationsFromArrayForPreferences​(@NotNull
                                                                                                       @NotNull NSArray<java.lang.String> localizationsArray,
                                                                                                       @Nullable
                                                                                                       @Nullable NSArray<java.lang.String> preferencesArray)
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • URLForAuxiliaryExecutable

        @Nullable
        public @Nullable NSURL URLForAuxiliaryExecutable​(@NotNull
                                                         @NotNull java.lang.String executableName)
        API-Since: 4.0
      • URLForResourceWithExtension

        @Nullable
        public @Nullable NSURL URLForResourceWithExtension​(@Nullable
                                                           @Nullable java.lang.String name,
                                                           @Nullable
                                                           @Nullable java.lang.String ext)
        API-Since: 4.0
      • URLForResourceWithExtensionSubdirectory

        @Nullable
        public @Nullable NSURL URLForResourceWithExtensionSubdirectory​(@Nullable
                                                                       @Nullable java.lang.String name,
                                                                       @Nullable
                                                                       @Nullable java.lang.String ext,
                                                                       @Nullable
                                                                       @Nullable java.lang.String subpath)
        API-Since: 4.0
      • URLForResourceWithExtensionSubdirectoryLocalization

        @Nullable
        public @Nullable NSURL URLForResourceWithExtensionSubdirectoryLocalization​(@Nullable
                                                                                   @Nullable java.lang.String name,
                                                                                   @Nullable
                                                                                   @Nullable java.lang.String ext,
                                                                                   @Nullable
                                                                                   @Nullable java.lang.String subpath,
                                                                                   @Nullable
                                                                                   @Nullable java.lang.String localizationName)
        API-Since: 4.0
      • URLsForResourcesWithExtensionSubdirectory

        @Nullable
        public @Nullable NSArray<? extends NSURL> URLsForResourcesWithExtensionSubdirectory​(@Nullable
                                                                                            @Nullable java.lang.String ext,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String subpath)
        API-Since: 4.0
      • URLsForResourcesWithExtensionSubdirectoryLocalization

        @Nullable
        public @Nullable NSArray<? extends NSURL> URLsForResourcesWithExtensionSubdirectoryLocalization​(@Nullable
                                                                                                        @Nullable java.lang.String ext,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String subpath,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String localizationName)
        API-Since: 4.0
      • appStoreReceiptURL

        @Nullable
        public @Nullable NSURL appStoreReceiptURL()
        API-Since: 7.0
      • builtInPlugInsPath

        @Nullable
        public @Nullable java.lang.String builtInPlugInsPath()
      • builtInPlugInsURL

        @Nullable
        public @Nullable NSURL builtInPlugInsURL()
        API-Since: 4.0
      • bundleIdentifier

        @Nullable
        public @Nullable java.lang.String bundleIdentifier()
        Methods for obtaining various information about a bundle.
      • bundlePath

        @NotNull
        public @NotNull java.lang.String bundlePath()
      • bundleURL

        @NotNull
        public @NotNull NSURL bundleURL()
        Methods for locating various components of a bundle. API-Since: 4.0
      • classNamed

        @Nullable
        public @Nullable org.moe.natj.objc.Class classNamed​(@NotNull
                                                            @NotNull java.lang.String className)
      • developmentLocalization

        @Nullable
        public @Nullable java.lang.String developmentLocalization()
      • executableArchitectures

        @Nullable
        public @Nullable NSArray<? extends NSNumber> executableArchitectures()
        API-Since: 2.0
      • executablePath

        @Nullable
        public @Nullable java.lang.String executablePath()
      • executableURL

        @Nullable
        public @Nullable NSURL executableURL()
        API-Since: 4.0
      • infoDictionary

        @Nullable
        public @Nullable NSDictionary<java.lang.String,​?> infoDictionary()
      • initWithPath

        public NSBundle initWithPath​(@NotNull
                                     @NotNull java.lang.String path)
      • initWithURL

        public NSBundle initWithURL​(@NotNull
                                    @NotNull NSURL url)
        API-Since: 4.0
      • isLoaded

        public boolean isLoaded()
      • load_objc

        public boolean load_objc()
        Methods for loading and unloading bundles.
      • loadAndReturnError

        public boolean loadAndReturnError​(@Nullable
                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 2.0
      • loadNibNamedOwnerOptions

        @Nullable
        public @Nullable NSArray<?> loadNibNamedOwnerOptions​(@NotNull
                                                             @NotNull java.lang.String name,
                                                             @Nullable
                                                             @Nullable java.lang.Object owner,
                                                             @Nullable
                                                             @Nullable NSDictionary<java.lang.String,​?> options)
      • localizations

        @NotNull
        public @NotNull NSArray<java.lang.String> localizations()
        list of language names this bundle appears to be localized to
      • localizedInfoDictionary

        @Nullable
        public @Nullable NSDictionary<java.lang.String,​?> localizedInfoDictionary()
      • localizedStringForKeyValueTable

        @NotNull
        public @NotNull java.lang.String localizedStringForKeyValueTable​(@NotNull
                                                                         @NotNull java.lang.String key,
                                                                         @Nullable
                                                                         @Nullable java.lang.String value,
                                                                         @Nullable
                                                                         @Nullable java.lang.String tableName)
        Methods for retrieving localized strings.
      • objectForInfoDictionaryKey

        @Nullable
        public @Nullable java.lang.Object objectForInfoDictionaryKey​(@NotNull
                                                                     @NotNull java.lang.String key)
      • pathForAuxiliaryExecutable

        @Nullable
        public @Nullable java.lang.String pathForAuxiliaryExecutable​(@NotNull
                                                                     @NotNull java.lang.String executableName)
      • pathForResourceOfType

        @Nullable
        public @Nullable java.lang.String pathForResourceOfType​(@Nullable
                                                                @Nullable java.lang.String name,
                                                                @Nullable
                                                                @Nullable java.lang.String ext)
      • pathForResourceOfTypeInDirectory

        @Nullable
        public @Nullable java.lang.String pathForResourceOfTypeInDirectory​(@Nullable
                                                                           @Nullable java.lang.String name,
                                                                           @Nullable
                                                                           @Nullable java.lang.String ext,
                                                                           @Nullable
                                                                           @Nullable java.lang.String subpath)
      • pathForResourceOfTypeInDirectoryForLocalization

        @Nullable
        public @Nullable java.lang.String pathForResourceOfTypeInDirectoryForLocalization​(@Nullable
                                                                                          @Nullable java.lang.String name,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String ext,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String subpath,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String localizationName)
      • pathsForResourcesOfTypeInDirectory

        @NotNull
        public @NotNull NSArray<java.lang.String> pathsForResourcesOfTypeInDirectory​(@Nullable
                                                                                     @Nullable java.lang.String ext,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String subpath)
      • pathsForResourcesOfTypeInDirectoryForLocalization

        @NotNull
        public @NotNull NSArray<java.lang.String> pathsForResourcesOfTypeInDirectoryForLocalization​(@Nullable
                                                                                                    @Nullable java.lang.String ext,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String subpath,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String localizationName)
      • preferredLocalizations

        @NotNull
        public @NotNull NSArray<java.lang.String> preferredLocalizations()
        a subset of this bundle's localizations, re-ordered into the preferred order for this process's current execution environment; the main bundle's preferred localizations indicate the language (of text) the user is most likely seeing in the UI
      • preflightAndReturnError

        public boolean preflightAndReturnError​(@Nullable
                                               @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 2.0
      • preservationPriorityForTag

        public double preservationPriorityForTag​(@NotNull
                                                 @NotNull java.lang.String tag)
        API-Since: 9.0
      • principalClass

        @Nullable
        public @Nullable org.moe.natj.objc.Class principalClass()
      • privateFrameworksPath

        @Nullable
        public @Nullable java.lang.String privateFrameworksPath()
      • privateFrameworksURL

        @Nullable
        public @Nullable NSURL privateFrameworksURL()
        API-Since: 4.0
      • resourcePath

        @Nullable
        public @Nullable java.lang.String resourcePath()
      • resourceURL

        @Nullable
        public @Nullable NSURL resourceURL()
        API-Since: 4.0
      • setPreservationPriorityForTags

        public void setPreservationPriorityForTags​(double priority,
                                                   @NotNull
                                                   @NotNull NSSet<java.lang.String> tags)
        Set a preservation priority for tags that are included in this bundle for the On Demand Resources system. Preservation priorities may be between 0.0 and 1.0, with higher values being the last choice for purging by the system. The exact meaning of this value is up to your application as it only has meaning within the set of tags your application uses. The default value is 0.0. This method will throw an exception if the receiver bundle has no on demand resource tag information. API-Since: 9.0
      • sharedFrameworksPath

        @Nullable
        public @Nullable java.lang.String sharedFrameworksPath()
      • sharedFrameworksURL

        @Nullable
        public @Nullable NSURL sharedFrameworksURL()
        API-Since: 4.0
      • sharedSupportPath

        @Nullable
        public @Nullable java.lang.String sharedSupportPath()
      • sharedSupportURL

        @Nullable
        public @Nullable NSURL sharedSupportURL()
        API-Since: 4.0
      • unload

        public boolean unload()
      • localizedAttributedStringForKeyValueTable

        @NotNull
        public @NotNull NSAttributedString localizedAttributedStringForKeyValueTable​(@NotNull
                                                                                     @NotNull java.lang.String key,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String value,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String tableName)
        API-Since: 15.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.