pub struct NSObject { /* private fields */ }Expand description
The root class of most Objective-C class hierarchies.
This represents the NSObject class. The name “NSObject” also
refers to a protocol, see NSObjectProtocol for that.
This class has been defined in objc since macOS 10.8, but is also
re-exported under objc2_foundation::NSObject, you might want to use that
path instead.
Implementations§
Source§impl NSObject
impl NSObject
Sourcepub fn init(this: Allocated<NSObject>) -> Retained<NSObject> ⓘ
pub fn init(this: Allocated<NSObject>) -> Retained<NSObject> ⓘ
Initialize an already allocated object.
See Apple’s documentation for details.
§Example
use objc2::runtime::NSObject;
use objc2::AnyThread;
let obj = NSObject::init(NSObject::alloc());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.
§Panics
May panic if the object is invalid (which may be the case for objects
returned from unavailable init/new methods).
§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,
this is difficult to use correctly, use 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 fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl AsRef<NSObject> for NSResponder
impl AsRef<NSObject> for NSResponder
Source§impl AsRef<NSObject> for NSNotification
impl AsRef<NSObject> for NSNotification
Source§impl Borrow<NSObject> for NSResponder
impl Borrow<NSObject> for NSResponder
Source§impl Borrow<NSObject> for NSNotification
impl Borrow<NSObject> for NSNotification
Source§impl ClassType for NSObject
impl ClassType for NSObject
Source§const NAME: &'static str = "NSObject"
const NAME: &'static str = "NSObject"
Source§type ThreadKind = dyn AnyThread
type ThreadKind = dyn AnyThread
Source§impl DefaultRetained for NSObject
impl DefaultRetained for NSObject
impl DowncastTarget for NSObject
impl Eq for NSObject
Most types’ equality is reflexive.
Source§impl Hash for NSObject
Hashing in Objective-C has the exact same requirement as in Rust:
impl Hash for NSObject
Hashing in Objective-C has the exact same requirement as in Rust:
If two objects are equal (as determined by the isEqual: method), they must have the same hash value.
See https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418859-hash
Source§impl NSObjectNSAccessibility for NSObject
impl NSObjectNSAccessibility for NSObject
Source§fn accessibilityAttributeNames(&self) -> Retained<NSArray<NSString>> ⓘ
fn accessibilityAttributeNames(&self) -> Retained<NSArray<NSString>> ⓘ
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityAttributeValue(
&self,
attribute: &NSString,
) -> Option<Retained<AnyObject>>
fn accessibilityAttributeValue( &self, attribute: &NSString, ) -> Option<Retained<AnyObject>>
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityIsAttributeSettable(&self, attribute: &NSString) -> bool
fn accessibilityIsAttributeSettable(&self, attribute: &NSString) -> bool
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§unsafe fn accessibilitySetValue_forAttribute(
&self,
value: Option<&AnyObject>,
attribute: &NSString,
)
unsafe fn accessibilitySetValue_forAttribute( &self, value: Option<&AnyObject>, attribute: &NSString, )
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityParameterizedAttributeNames(
&self,
) -> Retained<NSArray<NSString>> ⓘ
fn accessibilityParameterizedAttributeNames( &self, ) -> Retained<NSArray<NSString>> ⓘ
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§unsafe fn accessibilityAttributeValue_forParameter(
&self,
attribute: &NSString,
parameter: Option<&AnyObject>,
) -> Option<Retained<AnyObject>>
unsafe fn accessibilityAttributeValue_forParameter( &self, attribute: &NSString, parameter: Option<&AnyObject>, ) -> Option<Retained<AnyObject>>
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityActionNames(&self) -> Retained<NSArray<NSString>> ⓘ
fn accessibilityActionNames(&self) -> Retained<NSArray<NSString>> ⓘ
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityActionDescription(
&self,
action: &NSString,
) -> Option<Retained<NSString>>
fn accessibilityActionDescription( &self, action: &NSString, ) -> Option<Retained<NSString>>
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityPerformAction(&self, action: &NSString)
fn accessibilityPerformAction(&self, action: &NSString)
Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
Source§fn accessibilityIsIgnored(&self) -> bool
fn accessibilityIsIgnored(&self) -> bool
Use isAccessibilityElement instead
fn accessibilityHitTest(&self, point: CGPoint) -> Option<Retained<AnyObject>>
fn accessibilityFocusedUIElement(&self) -> Option<Retained<AnyObject>>
fn accessibilityArrayAttributeCount(&self, attribute: &NSString) -> usize
fn accessibilityArrayAttributeValues_index_maxCount( &self, attribute: &NSString, index: usize, max_count: usize, ) -> Retained<NSArray> ⓘ
fn accessibilityNotifiesWhenDestroyed(&self) -> bool
Source§impl NSObjectNSArchiverCallback for NSObject
impl NSObjectNSArchiverCallback for NSObject
fn classForArchiver(&self) -> Option<&'static AnyClass>
Source§fn replacementObjectForArchiver(
&self,
archiver: &NSArchiver,
) -> Option<Retained<AnyObject>>
fn replacementObjectForArchiver( &self, archiver: &NSArchiver, ) -> Option<Retained<AnyObject>>
Source§impl NSObjectNSClassDescriptionPrimitives for NSObject
impl NSObjectNSClassDescriptionPrimitives for NSObject
fn classDescription(&self) -> Retained<NSClassDescription> ⓘ
fn attributeKeys(&self) -> Retained<NSArray<NSString>> ⓘ
fn toOneRelationshipKeys(&self) -> Retained<NSArray<NSString>> ⓘ
fn toManyRelationshipKeys(&self) -> Retained<NSArray<NSString>> ⓘ
fn inverseForRelationshipKey( &self, relationship_key: &NSString, ) -> Option<Retained<NSString>>
Source§impl NSObjectNSCoderMethods for NSObject
impl NSObjectNSCoderMethods for NSObject
Source§impl NSObjectNSComparisonMethods for NSObject
impl NSObjectNSComparisonMethods for NSObject
Source§impl NSObjectNSDelayedPerforming for NSObject
impl NSObjectNSDelayedPerforming for NSObject
Source§unsafe fn performSelector_withObject_afterDelay_inModes(
&self,
a_selector: Sel,
an_argument: Option<&AnyObject>,
delay: f64,
modes: &NSArray<NSString>,
)
unsafe fn performSelector_withObject_afterDelay_inModes( &self, a_selector: Sel, an_argument: Option<&AnyObject>, delay: f64, modes: &NSArray<NSString>, )
Source§unsafe fn performSelector_withObject_afterDelay(
&self,
a_selector: Sel,
an_argument: Option<&AnyObject>,
delay: f64,
)
unsafe fn performSelector_withObject_afterDelay( &self, a_selector: Sel, an_argument: Option<&AnyObject>, delay: f64, )
Source§unsafe fn cancelPreviousPerformRequestsWithTarget_selector_object(
a_target: &AnyObject,
a_selector: Sel,
an_argument: Option<&AnyObject>,
)
unsafe fn cancelPreviousPerformRequestsWithTarget_selector_object( a_target: &AnyObject, a_selector: Sel, an_argument: Option<&AnyObject>, )
Source§unsafe fn cancelPreviousPerformRequestsWithTarget(a_target: &AnyObject)
unsafe fn cancelPreviousPerformRequestsWithTarget(a_target: &AnyObject)
Source§impl NSObjectNSErrorRecoveryAttempting for NSObject
impl NSObjectNSErrorRecoveryAttempting for NSObject
Source§unsafe fn attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo(
&self,
error: &NSError,
recovery_option_index: usize,
delegate: Option<&AnyObject>,
did_recover_selector: Option<Sel>,
context_info: *mut c_void,
)
unsafe fn attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo( &self, error: &NSError, recovery_option_index: usize, delegate: Option<&AnyObject>, did_recover_selector: Option<Sel>, context_info: *mut c_void, )
fn attemptRecoveryFromError_optionIndex( &self, error: &NSError, recovery_option_index: usize, ) -> bool
Source§impl NSObjectNSKeyValueBindingCreation for NSObject
impl NSObjectNSKeyValueBindingCreation for NSObject
fn exposeBinding(binding: &NSString)
fn exposedBindings(&self) -> Retained<NSArray<NSString>> ⓘ
fn valueClassForBinding(&self, binding: &NSString) -> Option<&'static AnyClass>
Source§unsafe fn bind_toObject_withKeyPath_options(
&self,
binding: &NSString,
observable: &AnyObject,
key_path: &NSString,
options: Option<&NSDictionary<NSString>>,
)
unsafe fn bind_toObject_withKeyPath_options( &self, binding: &NSString, observable: &AnyObject, key_path: &NSString, options: Option<&NSDictionary<NSString>>, )
fn unbind(&self, binding: &NSString)
fn infoForBinding( &self, binding: &NSString, ) -> Option<Retained<NSDictionary<NSString>>>
fn optionDescriptionsForBinding( &self, binding: &NSString, ) -> Retained<NSArray<NSAttributeDescription>> ⓘ
Source§impl NSObjectNSKeyValueCoding for NSObject
impl NSObjectNSKeyValueCoding for NSObject
fn accessInstanceVariablesDirectly() -> bool
fn valueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>
Source§unsafe fn validateValue_forKey_error(
&self,
io_value: &mut Option<Retained<AnyObject>>,
in_key: &NSString,
) -> Result<(), Retained<NSError>>
unsafe fn validateValue_forKey_error( &self, io_value: &mut Option<Retained<AnyObject>>, in_key: &NSString, ) -> Result<(), Retained<NSError>>
Source§unsafe fn mutableArrayValueForKey(
&self,
key: &NSString,
) -> Retained<NSMutableArray> ⓘ
unsafe fn mutableArrayValueForKey( &self, key: &NSString, ) -> Retained<NSMutableArray> ⓘ
Source§unsafe fn mutableOrderedSetValueForKey(
&self,
key: &NSString,
) -> Retained<NSMutableOrderedSet> ⓘ
unsafe fn mutableOrderedSetValueForKey( &self, key: &NSString, ) -> Retained<NSMutableOrderedSet> ⓘ
Source§unsafe fn mutableSetValueForKey(&self, key: &NSString) -> Retained<NSMutableSet> ⓘ
unsafe fn mutableSetValueForKey(&self, key: &NSString) -> Retained<NSMutableSet> ⓘ
fn valueForKeyPath(&self, key_path: &NSString) -> Option<Retained<AnyObject>>
Source§unsafe fn setValue_forKeyPath(
&self,
value: Option<&AnyObject>,
key_path: &NSString,
)
unsafe fn setValue_forKeyPath( &self, value: Option<&AnyObject>, key_path: &NSString, )
Source§unsafe fn validateValue_forKeyPath_error(
&self,
io_value: &mut Option<Retained<AnyObject>>,
in_key_path: &NSString,
) -> Result<(), Retained<NSError>>
unsafe fn validateValue_forKeyPath_error( &self, io_value: &mut Option<Retained<AnyObject>>, in_key_path: &NSString, ) -> Result<(), Retained<NSError>>
Source§unsafe fn mutableArrayValueForKeyPath(
&self,
key_path: &NSString,
) -> Retained<NSMutableArray> ⓘ
unsafe fn mutableArrayValueForKeyPath( &self, key_path: &NSString, ) -> Retained<NSMutableArray> ⓘ
Source§unsafe fn mutableOrderedSetValueForKeyPath(
&self,
key_path: &NSString,
) -> Retained<NSMutableOrderedSet> ⓘ
unsafe fn mutableOrderedSetValueForKeyPath( &self, key_path: &NSString, ) -> Retained<NSMutableOrderedSet> ⓘ
Source§unsafe fn mutableSetValueForKeyPath(
&self,
key_path: &NSString,
) -> Retained<NSMutableSet> ⓘ
unsafe fn mutableSetValueForKeyPath( &self, key_path: &NSString, ) -> Retained<NSMutableSet> ⓘ
fn valueForUndefinedKey(&self, key: &NSString) -> Option<Retained<AnyObject>>
Source§unsafe fn setValue_forUndefinedKey(
&self,
value: Option<&AnyObject>,
key: &NSString,
)
unsafe fn setValue_forUndefinedKey( &self, value: Option<&AnyObject>, key: &NSString, )
unsafe fn setNilValueForKey(&self, key: &NSString)
fn dictionaryWithValuesForKeys( &self, keys: &NSArray<NSString>, ) -> Retained<NSDictionary<NSString>> ⓘ
Source§unsafe fn setValuesForKeysWithDictionary(
&self,
keyed_values: &NSDictionary<NSString>,
)
unsafe fn setValuesForKeysWithDictionary( &self, keyed_values: &NSDictionary<NSString>, )
Source§impl NSObjectNSKeyValueObserverNotification for NSObject
impl NSObjectNSKeyValueObserverNotification for NSObject
fn willChangeValueForKey(&self, key: &NSString)
fn didChangeValueForKey(&self, key: &NSString)
fn willChange_valuesAtIndexes_forKey( &self, change_kind: NSKeyValueChange, indexes: &NSIndexSet, key: &NSString, )
fn didChange_valuesAtIndexes_forKey( &self, change_kind: NSKeyValueChange, indexes: &NSIndexSet, key: &NSString, )
Source§unsafe fn willChangeValueForKey_withSetMutation_usingObjects(
&self,
key: &NSString,
mutation_kind: NSKeyValueSetMutationKind,
objects: &NSSet,
)
unsafe fn willChangeValueForKey_withSetMutation_usingObjects( &self, key: &NSString, mutation_kind: NSKeyValueSetMutationKind, objects: &NSSet, )
Source§unsafe fn didChangeValueForKey_withSetMutation_usingObjects(
&self,
key: &NSString,
mutation_kind: NSKeyValueSetMutationKind,
objects: &NSSet,
)
unsafe fn didChangeValueForKey_withSetMutation_usingObjects( &self, key: &NSString, mutation_kind: NSKeyValueSetMutationKind, objects: &NSSet, )
Source§impl NSObjectNSKeyValueObserverRegistration for NSObject
impl NSObjectNSKeyValueObserverRegistration for NSObject
Source§unsafe fn addObserver_forKeyPath_options_context(
&self,
observer: &NSObject,
key_path: &NSString,
options: NSKeyValueObservingOptions,
context: *mut c_void,
)
unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, key_path: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, )
Source§impl NSObjectNSKeyValueObservingCustomization for NSObject
impl NSObjectNSKeyValueObservingCustomization for NSObject
fn keyPathsForValuesAffectingValueForKey( key: &NSString, ) -> Retained<NSSet<NSString>> ⓘ
fn automaticallyNotifiesObserversForKey(key: &NSString) -> bool
fn observationInfo(&self) -> *mut c_void
Source§unsafe fn setObservationInfo(&self, observation_info: *mut c_void)
unsafe fn setObservationInfo(&self, observation_info: *mut c_void)
observationInfo. Read moreSource§impl NSObjectNSKeyedArchiverObjectSubstitution for NSObject
impl NSObjectNSKeyedArchiverObjectSubstitution for NSObject
fn classForKeyedArchiver(&self) -> Option<&'static AnyClass>
fn replacementObjectForKeyedArchiver( &self, archiver: &NSKeyedArchiver, ) -> Option<Retained<AnyObject>>
fn classFallbacksForKeyedArchiver() -> Retained<NSArray<NSString>> ⓘ
Source§impl NSObjectNSKeyedUnarchiverObjectSubstitution for NSObject
impl NSObjectNSKeyedUnarchiverObjectSubstitution for NSObject
fn classForKeyedUnarchiver() -> &'static AnyClass
Source§impl NSObjectNSNibAwaking for NSObject
impl NSObjectNSNibAwaking for NSObject
fn awakeFromNib(&self)
fn prepareForInterfaceBuilder(&self)
Source§impl NSObjectNSScriptKeyValueCoding for NSObject
impl NSObjectNSScriptKeyValueCoding for NSObject
fn valueAtIndex_inPropertyWithKey( &self, index: usize, key: &NSString, ) -> Option<Retained<AnyObject>>
fn valueWithName_inPropertyWithKey( &self, name: &NSString, key: &NSString, ) -> Option<Retained<AnyObject>>
Source§unsafe fn valueWithUniqueID_inPropertyWithKey(
&self,
unique_id: &AnyObject,
key: &NSString,
) -> Option<Retained<AnyObject>>
unsafe fn valueWithUniqueID_inPropertyWithKey( &self, unique_id: &AnyObject, key: &NSString, ) -> Option<Retained<AnyObject>>
Source§unsafe fn insertValue_atIndex_inPropertyWithKey(
&self,
value: &AnyObject,
index: usize,
key: &NSString,
)
unsafe fn insertValue_atIndex_inPropertyWithKey( &self, value: &AnyObject, index: usize, key: &NSString, )
fn removeValueAtIndex_fromPropertyWithKey(&self, index: usize, key: &NSString)
Source§unsafe fn replaceValueAtIndex_inPropertyWithKey_withValue(
&self,
index: usize,
key: &NSString,
value: &AnyObject,
)
unsafe fn replaceValueAtIndex_inPropertyWithKey_withValue( &self, index: usize, key: &NSString, value: &AnyObject, )
Source§impl NSObjectNSScriptObjectSpecifiers for NSObject
impl NSObjectNSScriptObjectSpecifiers for NSObject
fn objectSpecifier(&self) -> Option<Retained<NSScriptObjectSpecifier>>
fn indicesOfObjectsByEvaluatingObjectSpecifier( &self, specifier: &NSScriptObjectSpecifier, ) -> Option<Retained<NSArray<NSNumber>>>
Source§impl NSObjectNSScripting for NSObject
impl NSObjectNSScripting for NSObject
fn scriptingValueForSpecifier( &self, object_specifier: &NSScriptObjectSpecifier, ) -> Option<Retained<AnyObject>>
fn scriptingProperties(&self) -> Option<Retained<NSDictionary<NSString>>>
Source§unsafe fn setScriptingProperties(
&self,
scripting_properties: Option<&NSDictionary<NSString>>,
)
unsafe fn setScriptingProperties( &self, scripting_properties: Option<&NSDictionary<NSString>>, )
scriptingProperties. Read moreSource§impl NSObjectNSThreadPerformAdditions for NSObject
impl NSObjectNSThreadPerformAdditions for NSObject
Source§unsafe fn performSelectorOnMainThread_withObject_waitUntilDone_modes(
&self,
a_selector: Sel,
arg: Option<&AnyObject>,
wait: bool,
array: Option<&NSArray<NSString>>,
)
unsafe fn performSelectorOnMainThread_withObject_waitUntilDone_modes( &self, a_selector: Sel, arg: Option<&AnyObject>, wait: bool, array: Option<&NSArray<NSString>>, )
Source§unsafe fn performSelectorOnMainThread_withObject_waitUntilDone(
&self,
a_selector: Sel,
arg: Option<&AnyObject>,
wait: bool,
)
unsafe fn performSelectorOnMainThread_withObject_waitUntilDone( &self, a_selector: Sel, arg: Option<&AnyObject>, wait: bool, )
Source§unsafe fn performSelector_onThread_withObject_waitUntilDone_modes(
&self,
a_selector: Sel,
thr: &NSThread,
arg: Option<&AnyObject>,
wait: bool,
array: Option<&NSArray<NSString>>,
)
unsafe fn performSelector_onThread_withObject_waitUntilDone_modes( &self, a_selector: Sel, thr: &NSThread, arg: Option<&AnyObject>, wait: bool, array: Option<&NSArray<NSString>>, )
Source§impl NSObjectProtocol for NSObject
impl NSObjectProtocol for NSObject
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
use isKindOfClass directly, or cast your objects with AnyObject::downcast_ref
Source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Source§fn description(&self) -> Retained<NSObject> ⓘ
fn description(&self) -> Retained<NSObject> ⓘ
Source§fn debugDescription(&self) -> Retained<NSObject> ⓘ
fn debugDescription(&self) -> Retained<NSObject> ⓘ
Source§impl PartialEq for NSObject
Objective-C equality has approximately the same semantics as Rust
equality (although less aptly specified).
impl PartialEq for NSObject
Objective-C equality has approximately the same semantics as Rust equality (although less aptly specified).
At the very least, equality is expected to be symmetric and transitive, and that’s about the best we can do.
See also https://nshipster.com/equality/
Auto Trait Implementations§
impl !Freeze for NSObject
impl !RefUnwindSafe for NSObject
impl !Send for NSObject
impl !Sync for NSObject
impl !Unpin for NSObject
impl !UnwindSafe for NSObject
impl UnsafeUnpin for NSObject
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.