### start Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSThread.html Starts the receiver. ```APIDOC ## start ### Description Starts the receiver. ### Method `fn start(&self)` ``` -------------------------------- ### start Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURLConnection.rs.html Starts the connection, sending the request. ```APIDOC ## start ### Description Starts the connection, sending the request. ### Method `start` ``` -------------------------------- ### startQuery Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSMetadata.rs.html Starts the metadata query. Returns `true` if the query was successfully started, `false` otherwise. ```APIDOC ## startQuery ### Description Starts the metadata query. ### Method `startQuery` ### Endpoint `startQuery` ### Parameters None ### Request Example ```objc // Example usage (conceptual) BOOL started = [metadataQuery startQuery]; ``` ### Response #### Success Response * **return value** (bool) - `true` if the query started successfully, `false` otherwise. ### Error Handling None explicitly documented. ``` -------------------------------- ### startLoading Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLProtocol.html Starts protocol-specific loading of a request. When this method is called, the protocol implementation should start loading a request. ```APIDOC ## pub fn startLoading ### Description Starts protocol-specific loading of a request. When this method is called, the protocol implementation should start loading a request. ``` -------------------------------- ### NSSpellServer run Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSSpellServer.html Starts the spell server. ```APIDOC ## run ### Description Starts the spell server. This method initiates the spell-checking service. ### Returns This method does not return a value. ``` -------------------------------- ### Get Start Subelement Index Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSWhoseSpecifier.html Retrieves the index for the starting subelement of the NSWhoseSpecifier. ```rust pub fn startSubelementIndex(&self) -> NSInteger ``` -------------------------------- ### NSGetCommand::initWithCommandDescription Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptStandardSuiteCommands.rs.html Initializes an NSGetCommand with a given command description. ```APIDOC ## NSGetCommand::initWithCommandDescription ### Description Initializes an NSGetCommand with a given command description. ### Method initWithCommandDescription: ### Parameters - **command_def** (NSScriptCommandDescription) - The command description to initialize with. ### Response - **Self** (Retained) - The initialized NSGetCommand instance. ``` -------------------------------- ### Get Start Subelement Identifier Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSWhoseSpecifier.html Retrieves the identifier for the starting subelement of the NSWhoseSpecifier. ```rust pub fn startSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMachBootstrapServer.html Initializes a new instance of NSMachBootstrapServer. This is a standard NSObject initialization method. ```APIDOC ## init ### Description Initializes a new instance of NSMachBootstrapServer. This is a standard NSObject initialization method. ### Parameters #### Path Parameters - **this** (`Allocated`) - The allocated instance. ### Returns - Retained: The initialized instance. ``` -------------------------------- ### NSKeyValueSharedObservers::init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSKeyValueSharedObservers.html Initializes a new NSKeyValueSharedObservers instance. ```APIDOC ## NSKeyValueSharedObservers::init ### Description Initializes a new NSKeyValueSharedObservers instance. ### Method `unsafe fn init(this: Allocated) -> Retained` ``` -------------------------------- ### Get Start Date of NSDateInterval Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateInterval.html Retrieves the start date of an NSDateInterval. Requires the `NSDate` feature flag. ```rust pub fn startDate(&self) -> Retained ``` -------------------------------- ### Get Start Specifier for NSRangeSpecifier Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Retrieves the start specifier from an NSRangeSpecifier. Returns an Option containing a Retained NSScriptObjectSpecifier. ```rust impl NSRangeSpecifier { #[unsafe(method(startSpecifier))] #[unsafe(method_family = none)] pub fn startSpecifier(&self) -> Option>; } ``` -------------------------------- ### new Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMachBootstrapServer.html Creates and returns a new instance of NSMachBootstrapServer. This is a standard NSObject convenience constructor. ```APIDOC ## new ### Description Creates and returns a new instance of NSMachBootstrapServer. This is a standard NSObject convenience constructor. ### Returns - Retained: A new instance of NSMachBootstrapServer. ``` -------------------------------- ### startSubelementIndex Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Gets the index for the start of a subelement. ```APIDOC ## startSubelementIndex ### Description Gets the index for the start of a subelement. ### Method `get` ### Returns * `NSInteger` - The start subelement index. ``` -------------------------------- ### Begin Activity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSProcessInfo.html Begins a process activity with specified options and reason. Requires the `NSString` feature. ```rust pub fn beginActivityWithOptions_reason( &self, options: NSActivityOptions, reason: &NSString, ) -> Retained> ``` -------------------------------- ### startSubelementIdentifier Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Gets the identifier for the start of a subelement. ```APIDOC ## startSubelementIdentifier ### Description Gets the identifier for the start of a subelement. ### Method `get` ### Returns * `NSWhoseSubelementIdentifier` - The start subelement identifier. ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURL.html Initializes a new NSURL instance. ```APIDOC ## init ### Description Initializes a new NSURL instance. ### Method `pub fn init(this: Allocated) -> Retained` ``` -------------------------------- ### Get Gregorian Start Date Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSDateFormatter.rs.html Retrieves the Gregorian start date for the date formatter. Requires the `NSDate` feature to be enabled. ```rust #[cfg(feature = "NSDate")] #[unsafe(method(gregorianStartDate))] #[unsafe(method_family = none)] pub fn gregorianStartDate(&self) -> Option>; ``` -------------------------------- ### NSGetCommand::init Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptStandardSuiteCommands.rs.html Initializes a new NSGetCommand instance. ```APIDOC ## NSGetCommand::init ### Description Initializes a new NSGetCommand instance. ### Method init ### Parameters None ### Response - **Self** (Retained) - The initialized NSGetCommand instance. ``` -------------------------------- ### Create and Start a New Thread Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/thread.rs.html A helper function to create and start a new `NSThread`. This is an example of thread creation and does not wait for completion. ```rust #[allow(unused)] fn make_multithreaded() { let thread = unsafe { NSThread::new() }; unsafe { thread.start() }; // Don't bother waiting for it to complete! } ``` -------------------------------- ### NSMoveCommand::initWithCommandDescription Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptStandardSuiteCommands.rs.html Initializes an NSMoveCommand with a given command description. ```APIDOC ## NSMoveCommand::initWithCommandDescription ### Description Initializes an NSMoveCommand with a given command description. ### Method initWithCommandDescription: ### Parameters - **command_def** (NSScriptCommandDescription) - The command description to initialize with. ### Response - **Self** (Retained) - The initialized NSMoveCommand instance. ``` -------------------------------- ### NSDateFormatter::twoDigitStartDate Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateFormatter.html Gets the two-digit start date used for parsing two-digit years. ```APIDOC ## NSDateFormatter::twoDigitStartDate ### Description Gets the two-digit start date used for parsing two-digit years. ### Method `fn twoDigitStartDate(&self) -> Option>` ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSNetService.html Initializes a new instance of NSNetService. ```APIDOC ## init ### Description Initializes a new instance of NSNetService. ``` -------------------------------- ### prefix Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSXMLNode.html Gets the namespace prefix of the node. For example, in 'foo:bar', the prefix is 'foo'. ```APIDOC ## prefix ### Description Gets the namespace prefix of the node. For example, in 'foo:bar', the prefix is 'foo'. ### Returns - `Option>`: The namespace prefix or nil. ``` -------------------------------- ### Get Shared HTTP Cookie Storage Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSHTTPCookieStorage.rs.html Retrieves the shared cookie storage object for the default location. Starting in OS X 10.11, this singleton is app-specific and not shared across applications. ```rust use objc2::foundation::NSHTTPCookieStorage; let storage = NSHTTPCookieStorage::sharedHTTPCookieStorage(); ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURLDownload.rs.html Initializes a new instance of NSURLDownload. ```APIDOC ## init ### Description Initializes a new instance of NSURLDownload. ### Returns A retained instance of NSURLDownload. ### Method Signature `fn init(this: Allocated) -> Retained` ``` -------------------------------- ### NSURLConnection::start Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLConnection.html Starts the connection, sending the request and receiving the response. ```APIDOC ## start ### Description Starts the connection, sending the request and receiving the response. ### Method `start` ``` -------------------------------- ### Begin Process Activity Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSProcessInfo.rs.html Starts a new process activity with specified options and a reason. Returns a retained object representing the activity. Requires `NSString` feature. ```rust pub fn beginActivityWithOptions_reason( &self, options: NSActivityOptions, reason: &NSString, ) -> Retained>; ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/type.NSStreamNetworkServiceTypeValue.html Initializes a new instance of the class. ```APIDOC ## init ### Description Initializes a new instance of the class. ### Method `objc` ### Endpoint `- (Retained)init` ``` -------------------------------- ### Set Start Subelement Index Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSWhoseSpecifier.html Sets the index for the starting subelement of the NSWhoseSpecifier. ```rust pub fn setStartSubelementIndex(&self, start_subelement_index: NSInteger) ``` -------------------------------- ### Set Start Subelement Identifier Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSWhoseSpecifier.html Sets the identifier for the starting subelement of the NSWhoseSpecifier. ```rust pub fn setStartSubelementIdentifier( &self, start_subelement_identifier: NSWhoseSubelementIdentifier, ) ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/type.NSRunLoopMode.html Initializes a new instance of the class. ```APIDOC ## init ### Description Initializes a new instance of the class. ### Method `objc` ### Signature `pub fn init(this: Allocated) -> Retained` ``` -------------------------------- ### Get and Set Delegate for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the delegate for the NSUserActivity. This is a weak property. ```rust pub fn delegate( &self, ) -> Option>> ``` ```rust pub fn setDelegate( &self, delegate: Option<&ProtocolObject>, ) ``` -------------------------------- ### NSAppleScript Initialization and Creation Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSAppleScript.rs.html Provides documentation for initializing and creating new instances of NSAppleScript. ```APIDOC ## NSAppleScript Methods ### Description This section documents the methods available for `NSAppleScript` instances, including initialization and creation. ### Methods #### `init()` - **Description**: Initializes a new instance of `NSAppleScript`. - **Signature**: `pub fn init(this: Allocated) -> Retained` #### `new()` - **Description**: Creates a new instance of `NSAppleScript`. - **Signature**: `pub fn new() -> Retained` ### Default Initialization #### `default_retained()` - **Description**: Returns a default retained instance of `NSAppleScript` by calling `Self::new()`. - **Signature**: `fn default_retained() -> Retained` ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/type.NSKeyValueChangeKey.html Initializes a new instance of the string. ```APIDOC ## init ### Description Initializes a new instance of the string. ### Method `objc` ### Endpoint `- (instancetype)init` ``` -------------------------------- ### Get and Set Query Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the query of the NSURLComponents object. This is copied when set. ```rust pub fn query(&self) -> Option> ``` ```rust pub fn setQuery(&self, query: Option<&NSString>) ``` -------------------------------- ### Get and Set Path Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the path of the NSURLComponents object. This is copied when set. ```rust pub fn path(&self) -> Option> ``` ```rust pub fn setPath(&self, path: Option<&NSString>) ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSFileHandle.rs.html Initializes a new NSFileHandle object with default settings. ```APIDOC ## init ### Description Initializes a new NSFileHandle object. ### Method `init` ### Endpoint N/A (Objective-C method) ### Parameters None ### Response #### Success Response - **Retained** - The initialized NSFileHandle object. ``` -------------------------------- ### NSScriptCommand Initialization Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptCommand.rs.html Demonstrates the `init` and `new` methods for initializing an NSScriptCommand instance. These are standard Objective-C initialization patterns. ```rust impl NSScriptCommand { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } ``` -------------------------------- ### Get and Set Port Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the port of the NSURLComponents object. This is copied when set. ```rust pub fn port(&self) -> Option> ``` ```rust pub fn setPort(&self, port: Option<&NSNumber>) ``` -------------------------------- ### init() Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUnitIlluminance.html Initializes a new NSUnitIlluminance instance. This is an unsafe operation. ```APIDOC ## pub unsafe fn init(this: Allocated) -> Retained ### Description Initializes a new `NSUnitIlluminance` instance. ### Safety This method is unsafe. ``` -------------------------------- ### Get and Set Host Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the host of the NSURLComponents object. This is copied when set. ```rust pub fn host(&self) -> Option> ``` ```rust pub fn setHost(&self, host: Option<&NSString>) ``` -------------------------------- ### Get and Set Password Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the password of the NSURLComponents object. This is copied when set. ```rust pub fn password(&self) -> Option> ``` ```rust pub fn setPassword(&self, password: Option<&NSString>) ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSXMLElement.html Initializes a new NSXMLElement instance. ```APIDOC ## init ### Description Initializes a new NSXMLElement instance. ### Method Not specified (likely Objective-C/Swift method call) ### Parameters None ``` -------------------------------- ### Initialize and Start a Download Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURLDownload.rs.html Initializes a new NSURLDownload object and begins the download process. This method is deprecated and NSURLSession downloadTask should be used instead. ```rust use objc2::foundation::{NSURLRequest, NSURLDownload}; use objc2::runtime::MessageReceiver; // Assuming `request` is an NSURLRequest and `delegate` is an Option<&ProtocolObject> let download = NSURLDownload::alloc().initWithRequest_delegate(request, delegate); ``` -------------------------------- ### Get and Set User Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the user of the NSURLComponents object. This is copied when set. ```rust pub fn user(&self) -> Option> ``` ```rust pub fn setUser(&self, user: Option<&NSString>) ``` -------------------------------- ### NSXPCInterface::init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSXPCInterface.html Initializes a new NSXPCInterface. This is an unsafe operation. ```APIDOC ## NSObject::init for NSXPCInterface ### Description Initializes a new `NSXPCInterface` instance. ### Safety This is a standard NSObject initialization method and should be called on an allocated object. ### Signature `pub fn init(this: Allocated) -> Retained` ``` -------------------------------- ### Get and Set Scheme Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLComponents.html Gets or sets the scheme of the NSURLComponents object. This is copied when set. ```rust pub fn scheme(&self) -> Option> ``` ```rust pub fn setScheme(&self, scheme: Option<&NSString>) ``` -------------------------------- ### isStarted Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSMetadata.rs.html Checks if the metadata query is currently started. Returns `true` if started, `false` otherwise. ```APIDOC ## isStarted ### Description Checks if the metadata query is currently started. ### Method `isStarted` ### Endpoint `isStarted` ### Parameters None ### Request Example ```objc // Example usage (conceptual) BOOL isRunning = [metadataQuery isStarted]; ``` ### Response #### Success Response * **return value** (bool) - `true` if the query is started, `false` otherwise. ### Error Handling None explicitly documented. ``` -------------------------------- ### Initialize NSURL with Scheme, Host, and Path Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Creates a new NSURL instance using a scheme, host, and path. Note: This method is deprecated in favor of NSURLComponents. ```rust pub fn initWithScheme_host_path( this: Allocated, scheme: &NSString, host: Option<&NSString>, path: &NSString, ) -> Option>; ``` -------------------------------- ### initWithSymbol(_:) Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUnitIlluminance.html Initializes a new NSUnitIlluminance with a symbol. Available only when the `NSString` crate feature is enabled. ```APIDOC ## pub fn initWithSymbol(this: Allocated, symbol: &NSString) -> Retained ### Description Initializes a new `NSUnitIlluminance` with a symbol. ### Availability Available on **crate feature `NSString`** only. ``` -------------------------------- ### Get Filename for NSFileWrapper Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSFileWrapper.html Gets the filename associated with the file wrapper. Requires the `NSString` feature. ```rust pub fn filename(&self) -> Option> ``` -------------------------------- ### Initialize NSScriptCommandDescription with Suite, Command, and Declaration Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptCommandDescription.rs.html Initializes a new NSScriptCommandDescription with a suite name, command name, and an optional dictionary for command declaration. Requires `NSDictionary` and `NSString` features. ```rust #[cfg(all(feature = "NSDictionary", feature = "NSString"))] /// # Safety /// /// `command_declaration` generic should be of the correct type. #[unsafe(method(initWithSuiteName:commandName:dictionary:))] #[unsafe(method_family = init)] pub unsafe fn initWithSuiteName_commandName_dictionary( this: Allocated, suite_name: &NSString, command_name: &NSString, command_declaration: Option<&NSDictionary>, ) -> Option>; ``` -------------------------------- ### Set Start Specifier for NSRangeSpecifier Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Sets the start specifier for an NSRangeSpecifier. Accepts an Option of a reference to an NSScriptObjectSpecifier. ```rust impl NSRangeSpecifier { /// Setter for [`startSpecifier`][Self::startSpecifier]. #[unsafe(method(setStartSpecifier:))] #[unsafe(method_family = none)] pub fn setStartSpecifier(&self, start_specifier: Option<&NSScriptObjectSpecifier>); } ``` -------------------------------- ### NSCreateCommand::initWithCommandDescription Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSCreateCommand.html Initializes a new NSCreateCommand with the provided command description. This method is available only when the `NSScriptCommandDescription` feature is enabled. ```APIDOC ## NSCreateCommand::initWithCommandDescription ### Description Initializes a new NSCreateCommand with the provided command description. ### Parameters - **command_def** (*&NSScriptCommandDescription*) - The command description to initialize with. ### Returns - Retained - The initialized NSCreateCommand instance. ### Availability Available on crate feature`NSScriptCommandDescription` only. ``` -------------------------------- ### Get and Set Base Specifier for NSRelativeSpecifier Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Provides methods to get and set the base specifier for an NSRelativeSpecifier. ```rust impl NSRelativeSpecifier { extern_methods!( #[unsafe(method(baseSpecifier))] #[unsafe(method_family = none)] pub fn baseSpecifier(&self) -> Option>; /// Setter for [`baseSpecifier`][Self::baseSpecifier]. #[unsafe(method(setBaseSpecifier:))] #[unsafe(method_family = none)] pub fn setBaseSpecifier(&self, base_specifier: Option<&NSScriptObjectSpecifier>); ); } ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMoveCommand.html Initializes a new NSMoveCommand. ```APIDOC ### pub fn init(this: Allocated) -> Retained Initializes a new NSMoveCommand. ``` -------------------------------- ### Get and Set Relative Position for NSRelativeSpecifier Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptObjectSpecifiers.rs.html Provides methods to get and set the relative position of an NSRelativeSpecifier. ```rust impl NSRelativeSpecifier { extern_methods!( #[unsafe(method(relativePosition))] #[unsafe(method_family = none)] pub fn relativePosition(&self) -> NSRelativePosition; /// Setter for [`relativePosition`][Self::relativePosition]. #[unsafe(method(setRelativePosition:))] #[unsafe(method_family = none)] pub fn setRelativePosition(&self, relative_position: NSRelativePosition); ); } ``` -------------------------------- ### Initialize NSXMLDocument Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSXMLDocument.rs.html Creates a new instance of NSXMLDocument. ```rust Self::new() } } ``` -------------------------------- ### Get NSUUID as a String Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSUUID.rs.html Use `UUIDString` to get the string representation of an NSUUID. This returns a retained `NSString`. ```rust pub fn UUIDString(&self) -> Retained; ``` -------------------------------- ### NSWhoseSpecifier::init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSWhoseSpecifier.html Initializes a new NSWhoseSpecifier instance. ```APIDOC ## NSWhoseSpecifier::init ### Description Initializes a new NSWhoseSpecifier instance. ### Method `pub fn init(this: Allocated) -> Retained` ``` -------------------------------- ### HTTPMethod Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMutableURLRequest.html Gets the HTTP request method (e.g., GET, POST) for the NSMutableURLRequest. Available with the `NSString` feature. ```APIDOC ## HTTPMethod ### Description Returns the HTTP request method of the receiver. ### Returns - **Option>**: The HTTP request method of the receiver. ### Availability Available on `crate feature`NSString` only. ``` -------------------------------- ### Basic Usage of Foundation Types Source: https://docs.rs/objc2-foundation/latest/index.html Demonstrates the creation and comparison of NSObject instances, the creation and iteration of NSArray, and the conversion between NSArray and Vec. It also shows how to create static NSStrings and NSDictionary objects, and how to retrieve objects from a dictionary. ```rust use objc2_foundation::{ns_string, NSArray, NSDictionary, NSObject}; // Create and compare NSObjects let obj = NSObject::new(); #[allow(clippy::eq_op)] { println!("{obj:?} == {obj:?}? {{}}", obj == obj); } let obj2 = NSObject::new(); println!("{obj:?} == {obj2:?}? {{}}", obj == obj2); // Create an NSArray from a Vec let objs = vec![obj, obj2]; let array = NSArray::from_retained_slice(&objs); for obj in array.iter() { println!("{obj:?}"); } println!("{}", array.len()); // Turn the NSArray back into a Vec let mut objs = array.to_vec(); let obj = objs.pop().unwrap(); // Create a static NSString let string = ns_string!("Hello, world!"); // And use the `ToString` implementation to convert it into a string let _s = string.to_string(); // Or use the `Display` implementation directly println!("{string}"); // Create a dictionary mapping strings to objects let keys = &[string]; let objects = &[&*obj]; let dict = NSDictionary::from_slices(keys, objects); println!("{{:?}}", dict.objectForKey(string)); println!("{}", dict.len()); ``` -------------------------------- ### Initialize File URL with Path and Directory Flag Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Creates a file URL from a path, specifying if it's a directory. ```rust pub fn initFileURLWithPath_isDirectory( this: Allocated, path: &NSString, is_dir: bool, ) -> Retained; ``` -------------------------------- ### Start NSURLProtocol Loading Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURLProtocol.html Starts the protocol-specific loading of a request. Implementations should begin loading data when this method is called. ```rust pub fn startLoading(&self) ``` -------------------------------- ### Get the length of an NSIndexPath Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSIndexPath.rs.html Use `length` to get the number of indexes in the NSIndexPath. This corresponds to the number of levels in the path. ```rust pub fn length(&self) -> NSUInteger; ``` -------------------------------- ### Get Preferred Filename for NSFileWrapper Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSFileWrapper.html Gets the preferred filename associated with the file wrapper. Requires the `NSString` feature. ```rust pub fn preferredFilename(&self) -> Option> ``` -------------------------------- ### Create, Read, and Remove File using NSURL Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/url.rs.html Demonstrates creating an NSURL from a file path, writing to it, asserting its content, and then removing it using Objective-C Foundation APIs. ```rust let url = NSURL::from_file_path("%F8").unwrap(); // Create, read and remove file, using different APIs. std::fs::write(path, "").unwrap(); assert_eq!(NSData::dataWithContentsOfURL(&url), Some(NSData::new())); manager.removeItemAtURL_error(&url).unwrap(); ``` -------------------------------- ### Get the Last Index Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSIndexSet.rs.html Use `lastIndex` to get the largest index present in the NSIndexSet. Returns `NSNotFound` if the set is empty. ```rust use objc2::__framework_prelude::* use objc2_foundation::NSIndexSet; let index_set = NSIndexSet::indexSetWithIndexesInRange(NSRange { location: 5, length: 3 }); // Indexes 5, 6, 7 assert_eq!(index_set.lastIndex(), 7); ``` -------------------------------- ### initWithCommandDescription Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMoveCommand.html Initializes a new NSMoveCommand with a command description. This method is available when the `NSScriptCommandDescription` feature is enabled. ```APIDOC ### pub fn initWithCommandDescription(this: Allocated, command_def: &NSScriptCommandDescription) -> Retained Available on **crate feature`NSScriptCommandDescription`** only. Initializes a new NSMoveCommand with a command description. ``` -------------------------------- ### Get the First Index Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSIndexSet.rs.html Use `firstIndex` to get the smallest index present in the NSIndexSet. Returns `NSNotFound` if the set is empty. ```rust use objc2::__framework_prelude::* use objc2_foundation::NSIndexSet; let index_set = NSIndexSet::indexSetWithIndexesInRange(NSRange { location: 5, length: 3 }); // Indexes 5, 6, 7 assert_eq!(index_set.firstIndex(), 5); ``` -------------------------------- ### NSGetCommand Initialization Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSGetCommand.html Initializes a new NSGetCommand instance. `initWithCommandDescription` is used to initialize with a command definition, while `initWithCoder` is for deserialization. `init` and `new` provide basic initialization. ```APIDOC ## NSGetCommand Initialization ### Description Initializes a new NSGetCommand instance. `initWithCommandDescription` is used to initialize with a command definition, while `initWithCoder` is for deserialization. `init` and `new` provide basic initialization. ### Methods #### `initWithCommandDescription` - **Signature**: `pub fn initWithCommandDescription(this: Allocated, command_def: &NSScriptCommandDescription) -> Retained` - **Availability**: Available on crate feature `NSScriptCommandDescription` only. #### `initWithCoder` - **Signature**: `pub unsafe fn initWithCoder(this: Allocated, in_coder: &NSCoder) -> Option>` - **Availability**: Available on crate feature `NSCoder` only. - **Safety**: `in_coder` possibly has further requirements. #### `init` - **Signature**: `pub fn init(this: Allocated) -> Retained` #### `new` - **Signature**: `pub fn new() -> Retained` ``` -------------------------------- ### Set Two Digit Start Date for NSDateFormatter Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateFormatter.html Specifies the start date for interpreting two-digit years. Requires the `NSDate` feature. ```rust let formatter = NSDateFormatter::new(); let start_date = NSDate::new(0.0); // Represents January 1, 1970, 00:00:00 GMT formatter.set_two_digit_start_date(Some(&start_date)); ``` -------------------------------- ### Initialize File URL with Path Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Creates a file URL from a path. ```rust pub fn initFileURLWithPath(this: Allocated, path: &NSString) -> Retained; ``` -------------------------------- ### Initialize File URL with Path, Directory Flag, and Base URL Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Creates a file URL from a path, specifying if it's a directory and an optional base URL. ```rust pub fn initFileURLWithPath_isDirectory_relativeToURL( this: Allocated, path: &NSString, is_dir: bool, base_url: Option<&NSURL>, ) -> Retained; ``` -------------------------------- ### Initialize NSDateInterval with Start Date and Duration Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateInterval.html Creates an NSDateInterval using a start date and a duration. Requires the `NSDate` feature flag. ```rust pub fn initWithStartDate_duration( this: Allocated, start_date: &NSDate, duration: NSTimeInterval, ) -> Retained ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDictionary.html Initializes a new instance of NSDictionary. ```APIDOC ## init ### Description Initializes a new instance of NSDictionary. ### Method `init(this: Allocated) -> Retained` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **this** (`Allocated`) - The allocated instance to initialize. ### Returns `Retained` - The initialized NSDictionary instance. ``` -------------------------------- ### Get and Set Title for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the title for the NSUserActivity. The title is copied when set. Available when the `NSString` feature is enabled. ```rust pub fn title(&self) -> Option> ``` ```rust pub fn setTitle(&self, title: Option<&NSString>) ``` -------------------------------- ### Deprecated: Get Week from NSDateComponents Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateComponents.html Deprecated method to get the week. Use -weekOfMonth or -weekOfYear instead, depending on the intended meaning. ```rust pub fn week(&self) -> NSInteger ``` -------------------------------- ### Initialize NSMachBootstrapServer Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSPortNameServer.rs.html Initializes a new NSMachBootstrapServer instance. This is a standard NSObject initialization method. ```rust impl NSMachBootstrapServer { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] ``` -------------------------------- ### Initialize File URL with Path and Base URL Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Creates a file URL from a path, with an optional base URL. ```rust pub fn initFileURLWithPath_relativeToURL( this: Allocated, path: &NSString, base_url: Option<&NSURL>, ) -> Retained; ``` -------------------------------- ### Initialize NSDateInterval with Start and End Dates Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateInterval.html Creates an NSDateInterval using a start date and an end date. Requires the `NSDate` feature flag. ```rust pub fn initWithStartDate_endDate( this: Allocated, start_date: &NSDate, end_date: &NSDate, ) -> Retained ``` -------------------------------- ### NSHost Initialization Methods Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSHost.rs.html Defines the initialization methods for NSHost, including `init` and `new`, allowing for the creation of new NSHost instances. ```rust impl NSHost { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } ``` -------------------------------- ### Get and Set User Info Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSUserActivity.rs.html Gets or sets the user information dictionary for the NSUserActivity. The dictionary is copied when set. Requires the `NSDictionary` feature. ```rust pub fn userInfo(&self) -> Option>; /// Setter for [`userInfo`][Self::userInfo]. /// /// This is [copied][crate::NSCopying::copy] when set. /// /// # Safety /// /// `user_info` generic should be of the correct type. #[unsafe(method(setUserInfo:))] #[unsafe(method_family = none)] pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>); ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUnitFuelEfficiency.html Initializes a new NSUnitFuelEfficiency instance. ```APIDOC ## init ### Description Initializes a new `NSUnitFuelEfficiency` instance. ### Method `pub unsafe fn init(this: Allocated) -> Retained` ``` -------------------------------- ### Get Current User Name Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSPathUtilities.rs.html Retrieves the current user's name as an NSString. This function is typically used to get user-specific information. ```rust use core::ffi::* use core::ptr::NonNull; use objc2::__framework_prelude::*; use crate::*; #[cfg(feature = "NSString")] #[inline] pub extern "C-unwind" fn NSUserName() -> Retained { extern "C-unwind" { fn NSUserName() -> *mut NSString; } let ret = unsafe { NSUserName() }; unsafe { Retained::retain_autoreleased(ret) } } ``` -------------------------------- ### initWithString Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSURL.rs.html Initializes a new `NSURLComponents` instance with a given URL string. ```APIDOC ## initWithString ### Description Initializes a new `NSURLComponents` instance with a given URL string. ### Method `initWithString` ### Parameters #### Path Parameters - **url_string** (`&NSString`) - The URL string to initialize the components with. ### Returns - `Option>` - An initialized `NSURLComponents` object if the URL string is valid, otherwise `nil`. ``` -------------------------------- ### Get and Set Keywords for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the keywords associated with the NSUserActivity. This is copied when set. Available when the `NSSet` and `NSString` features are enabled. ```rust pub fn keywords(&self) -> Retained> ``` ```rust pub fn setKeywords(&self, keywords: &NSSet) ``` -------------------------------- ### Get and Set Expiration Date for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the expiration date for the NSUserActivity. This is copied when set. Available when the `NSDate` feature is enabled. ```rust pub fn expirationDate(&self) -> Option> ``` ```rust pub fn setExpirationDate(&self, expiration_date: Option<&NSDate>) ``` -------------------------------- ### Initialization Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSXPCConnection.html Initializes a new NSXPCConnection with a service name, Mach service name and options, or an NSXPCListenerEndpoint. ```APIDOC ## Initializers ### `initWithServiceName` Initializes a new NSXPCConnection with the specified service name. ```objc - (instancetype)initWithServiceName:(NSString *)service_name; ``` ### `initWithMachServiceName:options:` Initializes a new NSXPCConnection with the specified Mach service name and options. ```objc - (instancetype)initWithMachServiceName:(NSString *)name options:(NSXPCConnectionOptions)options; ``` ### `initWithListenerEndpoint:` Initializes a new NSXPCConnection with the specified listener endpoint. ```objc - (instancetype)initWithListenerEndpoint:(NSXPCListenerEndpoint *)endpoint; ``` ``` -------------------------------- ### Get and Set Referrer URL for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the referrer URL for the NSUserActivity. This is copied when set. Available when the `NSURL` feature is enabled. ```rust pub fn referrerURL(&self) -> Option> ``` ```rust pub fn setReferrerURL(&self, referrer_url: Option<&NSURL>) ``` -------------------------------- ### NSSpellServer - Getting Suggestions Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSSpellServer.html Illustrates how to get spelling suggestions for a given word using NSSpellServer. This is useful for providing correction options to the user. ```objc NSSpellServer *spellServer = [NSSpellServer sharedInstance]; NSString *misspelledWord = @"aple"; NSArray *suggestions = [spellServer suggestionsForWord:misspelledWord]; NSLog(@"Suggestions for '%@': %@", misspelledWord, suggestions); ``` -------------------------------- ### Initialize NSURL with Scheme, Host, and Path (Deprecated) Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSURL.html Deprecated method for initializing an NSURL. Use NSURLComponents instead for more flexibility. ```rust pub fn initWithScheme_host_path( this: Allocated, scheme: &NSString, host: Option<&NSString>, path: &NSString, ) -> Option> ``` -------------------------------- ### Get All Indices (Deprecated) Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSIndexPath.html Deprecated method to get all indices of an NSIndexPath. It is unsafe due to potential buffer overruns and should be replaced with `getIndexes:range:`. ```objc pub unsafe fn getIndexes(&self, indexes: NonNull) ``` -------------------------------- ### NSCreateCommand::init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSCreateCommand.html Initializes a new, empty NSCreateCommand instance. ```APIDOC ## NSCreateCommand::init ### Description Initializes a new, empty NSCreateCommand instance. ### Returns - Retained - The initialized NSCreateCommand instance. ``` -------------------------------- ### Getting String Representation of an Object Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSRelativeDateTimeFormatter.rs.html Safely gets a string representation for a given object. Requires the 'NSString' feature. The object must be of the correct type. ```rust #[cfg(feature = "NSString")] /// # Safety /// /// `obj` should be of the correct type. #[unsafe(method(stringForObjectValue:))] #[unsafe(method_family = none)] pub unsafe fn stringForObjectValue( &self, obj: Option<&AnyObject>, ) -> Option>; ``` -------------------------------- ### Initialize NSProcessInfo Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSProcessInfo.rs.html Provides methods for initializing an NSProcessInfo object. `init` is used for standard initialization, while `new` creates a new instance. ```rust pub fn init(this: Allocated) -> Retained; pub fn new() -> Retained; ``` -------------------------------- ### Get and Set Webpage URL for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the webpage URL associated with the NSUserActivity. This is copied when set. Available when the `NSURL` feature is enabled. ```rust pub fn webpageURL(&self) -> Option> ``` ```rust pub fn setWebpageURL(&self, webpage_url: Option<&NSURL>) ``` -------------------------------- ### NSFileSecurity init and new Methods Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSFileSecurity.html Shows the standard initialization methods for NSFileSecurity: `init` and `new`. ```rust pub fn init(this: Allocated) -> Retained ``` ```rust pub fn new() -> Retained ``` -------------------------------- ### Initialize Bundle From Path Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSBundle.html Initializes an `NSBundle` object for the bundle at the specified file system path. Requires the `NSString` feature. ```rust pub fn initWithPath( this: Allocated, path: &NSString, ) -> Option> ``` -------------------------------- ### Get C String (Unsafe, Deprecated) Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSMutableString.html Unsafely gets the C string into a provided buffer. Deprecated; use -getCString:maxLength:encoding: instead. ```rust pub unsafe fn getCString(&self, bytes: NonNull) ``` -------------------------------- ### NSSpellServer init Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSSpellServer.html Initializes a new instance of NSSpellServer. ```APIDOC ## init ### Description Initializes a new instance of the `NSSpellServer` struct. ### Parameters * **this** (`Allocated`) - The allocated instance to initialize. ### Returns A `Retained` representing the initialized `NSSpellServer` instance. ``` -------------------------------- ### Set Gregorian Start Date Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSDateFormatter.rs.html Sets the Gregorian start date for the date formatter. The provided date is copied when set. Requires the `NSDate` feature to be enabled. ```rust #[cfg(feature = "NSDate")] #[unsafe(method(setGregorianStartDate:))] #[unsafe(method_family = none)] pub fn setGregorianStartDate(&self, gregorian_start_date: Option<&NSDate>); ``` -------------------------------- ### Get and Set Target Content Identifier for NSUserActivity Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSUserActivity.html Get or set the target content identifier for the NSUserActivity. This is copied when set. Available when the `NSString` feature is enabled. ```rust pub fn targetContentIdentifier(&self) -> Option> ``` ```rust pub fn setTargetContentIdentifier( &self, target_content_identifier: Option<&NSString>, ) ``` -------------------------------- ### initWithContentsOfFile Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSDictionary.rs.html Initializes a new dictionary with contents loaded from a file. ```APIDOC ## initWithContentsOfFile ### Description Initializes a new dictionary with contents loaded from a file. ### Method `initWithContentsOfFile(this: Allocated, path: &NSString) -> Option>>` ### Parameters * **this** (Allocated) - The allocated instance of the dictionary. * **path** (&NSString) - The path to the file containing the dictionary data. ``` -------------------------------- ### Get Object Value for String with Error Description Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSDateComponentsFormatter.html Attempts to get an object value from a string, returning an error description if unsuccessful. Requires the `NSString` feature. ```rust pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, ) -> bool ``` -------------------------------- ### Get Object Value from String Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSDateComponentsFormatter.rs.html Safely attempts to get an object value from a string representation, potentially with an error description. This is an unsafe method requiring careful usage. ```rust pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, ) -> bool; ``` -------------------------------- ### init Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSGarbageCollector.rs.html Initializes the garbage collector. ```APIDOC ## init ### Description Initializes the garbage collector. ### Method `init` ### Returns `Retained` - An initialized `NSGarbageCollector` instance. ``` -------------------------------- ### NSQuitCommand Instance Methods Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSQuitCommand.html Provides information about the instance methods available for NSQuitCommand objects. ```APIDOC ## NSQuitCommand Instance Methods ### `as_super(&self) -> &Self::Super` Get an immutable reference to the superclass. ### `fmt(&self, f: &mut Formatter<'_>) -> Result` Formats the value using the given formatter. ### `default_retained() -> Retained` The default `Retained` for a type. ### `deref(&self) -> &Self::Target` Dereferences the value. ### `hash(&self, state: &mut H)` Feeds this value into the given `Hasher`. ### `hash_slice(data: &[Self], state: &mut H)` Feeds a slice of this type into the given `Hasher`. ### `retain(&self) -> Retained` Increment the reference count of the receiver. ### `encodeWithCoder(&self, coder: &NSCoder)` Available on **crate features`NSCoder` and `NSObject`** only. Safety Read more ### `initWithCoder(this: Allocated, coder: &NSCoder) -> Option>` Available on **crate features`NSCoder` and `NSObject`** only. Safety Read more ### `isEqual(&self, other: Option<&AnyObject>) -> bool` Check whether the object is equal to an arbitrary other object. ### `hash(&self) -> usize` An integer that can be used as a table address in a hash table structure. ### `isKindOfClass(&self, cls: &AnyClass) -> bool` Check if the object is an instance of the class, or one of its subclasses. ### `is_kind_of(&self) -> bool` 👎Deprecated: use `isKindOfClass` directly, or cast your objects with `AnyObject::downcast_ref` Check if the object is an instance of the class type, or one of its subclasses. ### `isMemberOfClass(&self, cls: &AnyClass) -> bool` Check if the object is an instance of a specific class, without checking subclasses. ### `respondsToSelector(&self, aSelector: Sel) -> bool` Check whether the object implements or inherits a method with the given selector. ### `conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool` Check whether the object conforms to a given protocol. ### `description(&self) -> Retained` A textual representation of the object. ### `debugDescription(&self) -> Retained` A textual representation of the object to use when debugging. ### `isProxy(&self) -> bool` Check whether the receiver is a subclass of the `NSProxy` root class instead of the usual `NSObject`. ### `retainCount(&self) -> usize` The reference count of the object. ### `eq(&self, other: &Self) -> bool` Tests for `self` and `other` values to be equal, and is used by `==`. ### `ne(&self, other: &Rhs) -> bool` Tests for `!=`. ``` -------------------------------- ### Get Utf16Char as a slice of u16 Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/__ns_macro_helpers/ns_string.rs.html A helper method for `Utf16Char` to get its representation as a slice of `u16`. This is useful for tests and other operations that need to access the encoded UTF-16 data. ```Rust fn as_slice(&self) -> &[u16] { &self.repr[..self.len] } ``` -------------------------------- ### Get and Set Units Style Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSRelativeDateTimeFormatter.html Shows how to get and set the units style for an NSRelativeDateTimeFormatter. This affects which date/time components (e.g., days, hours) are used in the formatted string. ```rust pub fn unitsStyle(&self) -> NSRelativeDateTimeFormatterUnitsStyle ``` ```rust pub fn setUnitsStyle(&self, units_style: NSRelativeDateTimeFormatterUnitsStyle) ``` -------------------------------- ### NSGetCommand::initWithCoder Source: https://docs.rs/objc2-foundation/latest/src/objc2_foundation/generated/NSScriptStandardSuiteCommands.rs.html Initializes an NSGetCommand from an NSCoder. ```APIDOC ## NSGetCommand::initWithCoder ### Description Initializes an NSGetCommand from an NSCoder. This method may have further requirements. ### Method initWithCoder: ### Parameters - **in_coder** (NSCoder) - The NSCoder to decode from. ### Response - **Option>** - An optional retained NSGetCommand instance if initialization is successful, otherwise None. ``` -------------------------------- ### Get Objective-C Type Encoding from NSValue Source: https://docs.rs/objc2-foundation/latest/objc2_foundation/struct.NSNumber.html Use `objCType` to get the Objective-C type encoding of the data stored in an `NSValue`. This returns a non-null pointer to a C string. ```rust use objc2_foundation::NSValue; // Assuming `val` is an NSValue // let val: NSValue = ...; let typeEncoding = unsafe { val.objCType() }; // Use typeEncoding carefully ```