Struct objc2_foundation::NSBundle
source · #[repr(C)]pub struct NSBundle { /* private fields */ }
Available on crate feature
NSBundle
only.Implementations§
source§impl NSBundle
impl NSBundle
pub fn mainBundle() -> Retained<NSBundle>
pub unsafe fn bundleWithPath(path: &NSString) -> Option<Retained<Self>>
Available on crate feature
NSString
only.pub unsafe fn initWithPath( this: Allocated<Self>, path: &NSString ) -> Option<Retained<Self>>
Available on crate feature
NSString
only.pub unsafe fn bundleWithURL(url: &NSURL) -> Option<Retained<Self>>
Available on crate feature
NSURL
only.pub unsafe fn initWithURL( this: Allocated<Self>, url: &NSURL ) -> Option<Retained<Self>>
Available on crate feature
NSURL
only.pub unsafe fn bundleForClass(a_class: &AnyClass) -> Retained<NSBundle>
pub unsafe fn bundleWithIdentifier( identifier: &NSString ) -> Option<Retained<NSBundle>>
Available on crate feature
NSString
only.pub unsafe fn allBundles() -> Retained<NSArray<NSBundle>>
Available on crate feature
NSArray
only.pub unsafe fn allFrameworks() -> Retained<NSArray<NSBundle>>
Available on crate feature
NSArray
only.pub unsafe fn load(&self) -> bool
pub unsafe fn isLoaded(&self) -> bool
pub unsafe fn unload(&self) -> bool
pub unsafe fn preflightAndReturnError(&self) -> Result<(), Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn loadAndReturnError(&self) -> Result<(), Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn bundleURL(&self) -> Retained<NSURL>
Available on crate feature
NSURL
only.pub unsafe fn resourceURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.pub unsafe fn executableURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.pub unsafe fn URLForAuxiliaryExecutable( &self, executable_name: &NSString ) -> Option<Retained<NSURL>>
Available on crate features
NSString
and NSURL
only.pub unsafe fn privateFrameworksURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.Available on crate feature
NSURL
only.Available on crate feature
NSURL
only.pub unsafe fn builtInPlugInsURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.pub unsafe fn appStoreReceiptURL(&self) -> Option<Retained<NSURL>>
Available on crate feature
NSURL
only.pub unsafe fn bundlePath(&self) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn resourcePath(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn executablePath(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn pathForAuxiliaryExecutable( &self, executable_name: &NSString ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn privateFrameworksPath(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.Available on crate feature
NSString
only.Available on crate feature
NSString
only.pub unsafe fn builtInPlugInsPath(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn URLForResource_withExtension_subdirectory_inBundleWithURL( name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, bundle_url: &NSURL ) -> Option<Retained<NSURL>>
Available on crate features
NSString
and NSURL
only.pub unsafe fn URLsForResourcesWithExtension_subdirectory_inBundleWithURL( ext: Option<&NSString>, subpath: Option<&NSString>, bundle_url: &NSURL ) -> Option<Retained<NSArray<NSURL>>>
Available on crate features
NSArray
and NSString
and NSURL
only.pub unsafe fn URLForResource_withExtension( &self, name: Option<&NSString>, ext: Option<&NSString> ) -> Option<Retained<NSURL>>
Available on crate features
NSString
and NSURL
only.pub unsafe fn URLForResource_withExtension_subdirectory( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString> ) -> Option<Retained<NSURL>>
Available on crate features
NSString
and NSURL
only.pub unsafe fn URLForResource_withExtension_subdirectory_localization( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, localization_name: Option<&NSString> ) -> Option<Retained<NSURL>>
Available on crate features
NSString
and NSURL
only.pub unsafe fn URLsForResourcesWithExtension_subdirectory( &self, ext: Option<&NSString>, subpath: Option<&NSString> ) -> Option<Retained<NSArray<NSURL>>>
Available on crate features
NSArray
and NSString
and NSURL
only.pub unsafe fn URLsForResourcesWithExtension_subdirectory_localization( &self, ext: Option<&NSString>, subpath: Option<&NSString>, localization_name: Option<&NSString> ) -> Option<Retained<NSArray<NSURL>>>
Available on crate features
NSArray
and NSString
and NSURL
only.pub unsafe fn pathForResource_ofType_inDirectory_class( name: Option<&NSString>, ext: Option<&NSString>, bundle_path: &NSString ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn pathsForResourcesOfType_inDirectory_class( ext: Option<&NSString>, bundle_path: &NSString ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn pathForResource_ofType( &self, name: Option<&NSString>, ext: Option<&NSString> ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn pathForResource_ofType_inDirectory( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString> ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn pathForResource_ofType_inDirectory_forLocalization( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, localization_name: Option<&NSString> ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn pathsForResourcesOfType_inDirectory( &self, ext: Option<&NSString>, subpath: Option<&NSString> ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn pathsForResourcesOfType_inDirectory_forLocalization( &self, ext: Option<&NSString>, subpath: Option<&NSString>, localization_name: Option<&NSString> ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn localizedStringForKey_value_table( &self, key: &NSString, value: Option<&NSString>, table_name: Option<&NSString> ) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn bundleIdentifier(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub fn infoDictionary( &self ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>
Available on crate features
NSDictionary
and NSString
only.pub unsafe fn localizedInfoDictionary( &self ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>
Available on crate features
NSDictionary
and NSString
only.pub unsafe fn objectForInfoDictionaryKey( &self, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate feature
NSString
only.pub unsafe fn classNamed( &self, class_name: &NSString ) -> Option<&'static AnyClass>
Available on crate feature
NSString
only.pub unsafe fn principalClass(&self) -> Option<&'static AnyClass>
pub unsafe fn preferredLocalizations(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn localizations(&self) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn developmentLocalization(&self) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn preferredLocalizationsFromArray( localizations_array: &NSArray<NSString> ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn preferredLocalizationsFromArray_forPreferences( localizations_array: &NSArray<NSString>, preferences_array: Option<&NSArray<NSString>> ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn executableArchitectures( &self ) -> Option<Retained<NSArray<NSNumber>>>
Available on crate features
NSArray
and NSValue
only.source§impl NSBundle
impl NSBundle
NSBundleResourceRequestAdditions
pub unsafe fn setPreservationPriority_forTags( &self, priority: c_double, tags: &NSSet<NSString> )
Available on crate features
NSSet
and NSString
only.pub unsafe fn preservationPriorityForTag(&self, tag: &NSString) -> c_double
Available on crate feature
NSString
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl BorrowMut<AnyObject> for NSBundle
impl BorrowMut<AnyObject> for NSBundle
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSBundle
impl BorrowMut<NSObject> for NSBundle
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for NSBundle
impl ClassType for NSBundle
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSBundle"
const NAME: &'static str = "NSBundle"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl NSObjectProtocol for NSBundle
impl NSObjectProtocol for NSBundle
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl PartialEq for NSBundle
impl PartialEq for NSBundle
source§impl RefEncode for NSBundle
impl RefEncode for NSBundle
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSBundle
impl Message for NSBundle
impl RefUnwindSafe for NSBundle
impl Send for NSBundle
impl StructuralPartialEq for NSBundle
impl Sync for NSBundle
impl UnwindSafe for NSBundle
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more