NSObject
Direct Subclass:
Indirect Subclass:
The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects.
Static Member Summary
Static Public Members | ||
public static get |
The default returns true. |
|
public static get |
|
|
public static get |
|
Static Method Summary
Static Public Methods | ||
public static |
The default implementation returns true. |
|
public static |
cancelPreviousPerformRequestsWithTarget(aTarget: Object): void All perform requests having the same target aTarget are canceled. |
|
public static |
cancelPreviousPerformRequestsWithTargetSelectorObject(aTarget: Object, aSelector: function, anArgument: Object): void All perform requests are canceled that have the same target as aTarget, argument as anArgument, and selector as aSelector. |
|
public static |
NSKeyedArchiver calls this method and stores the result inside the archive. |
|
public static |
During keyed unarchiving, instances of the receiver will be decoded as members of the returned class. |
|
public static |
conformsTo(protocol: Object): boolean A class is said to “conform to” a protocol if it adopts the protocol or inherits from another class that adopts it. |
|
public static |
|
|
public static |
defaultPlaceholderForMarkerWithBinding(marker: Object, binding: string): Object The marker can be nil or one of the constants described in Selection Markers. |
|
public static |
The debugger’s print-object command invokes this method to produce a textual description of an object.NSObject's implementation of this method simply prints the name of the class. |
|
public static |
exposeBinding(binding: string): void The bound property will be accessed using key-value-coding compliant methods. |
|
public static |
|
|
public static |
initWithCoder(coder: *): * |
|
public static |
initialize(): void The runtime sends initialize() to each class in a program just before the class, or any class that inherits from it, is sent its first message from within the program. |
|
public static |
instanceMethodFor(aSelector: function): function An error is generated if instances of the receiver can’t respond to aSelector messages.Use this method to ask the class object for the implementation of instance methods only. |
|
public static |
instancesRespondTo(aSelector: function): boolean If aSelector messages are forwarded to other objects, instances of the class are able to receive those messages without error even though this method returns false.To ask the class whether it, rather than its instances, can respond to a particular message, send to the class instead the NSObject protocol instance method responds(to:). |
|
public static |
isKeyExcludedFromWebScript(name: UnsafePointer<Int8>): boolean The default value is true. |
|
public static |
isSelectorExcludedFromWebScript(selector: function): boolean Only methods with valid parameters and return types are exported to the WebKit JavaScript environment. |
|
public static |
isSubclassOf(aClass: Object): boolean Returns a Boolean value that indicates whether the receiving class is a subclass of, or identical to, a given class. |
|
public static |
When an observer for the key is registered with an instance of the receiving class, key-value observing itself automatically observes all of the key paths for the same instance, and sends change notifications for the key to the observer when the value for any of those key paths changes.The default implementation of this method searches the receiving class for a method whose name matches the pattern +keyPathsForValuesAffecting<Key>, and returns the result of invoking that method if it is found. |
|
public static |
load(): void The load() message is sent to classes and categories that are both dynamically loaded and statically linked, but only if the newly loaded class or category implements a method that can respond.The order of initialization is as follows:All initializers in any framework you link to.All +load methods in your image.All C++ static initializers and C/C++ attribute(constructor) functions in your image.All initializers in frameworks that link to you.In addition:A class’s +load method is called after all of its superclasses’ +load methods.A category +load method is called after the class’s own +load method.In a custom implementation of load() you can therefore safely message other unrelated classes from the same image, but any load() methods implemented by those classes may not have run yet.ImportantCustom implementations of the load method for Swift classes bridged to Objective-C are not called automatically. |
|
public static |
resolveClassMethod(sel: function): boolean This method allows you to dynamically provide an implementation for a given selector. |
|
public static |
resolveInstanceMethod(sel: function): boolean This method and resolveClassMethod(_:) allow you to dynamically provide an implementation for a given selector.An Objective-C method is simply a C function that take at least two arguments—self and _cmd. |
|
public static |
setDefaultPlaceholderForMarkerWithBinding(placeholder: Object, marker: Object, binding: string): void The marker can be nil or one of the constants described in Selection Markers. |
|
public static |
setVersion(aVersion: number): void The version number is helpful when instances of the class are to be archived and reused later. |
|
public static |
superclass(): Object Returns the class object for the receiver’s superclass. |
|
public static |
If no version has been set, the default is 0. |
|
public static |
webScriptNameFor(selector: function): string It is your responsibility to ensure that the returned name is unique to the script invoking this method. |
|
public static |
webScriptNameForKey(name: UnsafePointer<Int8>): string Returns the scripting environment name for an attribute specified by a key. |
Constructor Summary
Public Constructor | ||
public |
An init() message is coupled with an alloc (or allocWithZone:) message in the same line of code:SomeClass *object = [[SomeClass alloc] init]; An object isn’t ready to be used until it has been initialized.The init() method defined in the NSObject class does no initialization; it simply returns self. |
Member Summary
Public Members | ||
public |
[key]: * |
|
public |
The activation point for the accessibility element, in screen coordinates. |
|
public |
accessibilityCustomActions: UIAccessibilityCustomAction[] An array of custom actions to display along with the built-in actions. |
|
public |
accessibilityCustomRotors: UIAccessibilityCustomRotor[] |
|
public |
An array of the accessibility elements in the container. |
|
public |
A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden. |
|
public get |
You can assume that the search for the focus has already been narrowed down to the accessibility element. |
|
public |
The frame of the accessibility element, in screen coordinates. |
|
public |
|
|
public |
A brief description of the result of performing an action on the accessibility element, in a localized string. |
|
public |
A succinct label that identifies the accessibility element, in a localized string. |
|
public |
The language in which to speak the accessibility element's label, value, and hint. |
|
public |
accessibilityNavigationStyle: UIAccessibilityNavigationStyle The navigation style to apply to the object and its elements. |
|
public get |
In macOS 10.9 and later, a custom accessibility object that is an NSObject subclass can post accessibility notifications if it meets the following criteria:The lifetime of the custom accessibility object must match the lifetime of the corresponding element in the app's UI.Typically, a custom accessibility object that acts as a proxy for an onscreen UI element gets autoreleased and deallocated immediately after the app responds to an accessibility request. Such an object can’t post accessibility notifications, because all registered observers get removed as soon as the object is deallocated. To correct this, an app must guarantee that a custom accessibility object remains allocated for as long as its corresponding UI element remains visible.The object must post the NSAccessibilityUIElementDestroyedNotification notification at the appropriate time. The appropriate time is most likely to be when the corresponding UI element is removed from the screen, but it can also be when the object itself is deallocated. The object must implement accessibilityNotifiesWhenDestroyed and return true. |
|
public |
accessibilityPath: UIBezierPath The path of the element, in screen coordinates. |
|
public |
accessibilityTraits: UIAccessibilityTraits The combination of accessibility traits that best characterize the accessibility element. |
|
public |
The value of the accessibility element, in a localized string. |
|
public |
A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. |
|
public get |
NSObject’s implementation of attributeKeys simply calls [[self classDescription] attributeKeys]. |
|
public get |
This property returns a proxy for the receiving object if the receiver adopts the NSDiscardableContent protocol and still has content that has not been discarded.The proxy calls beginContentAccess() on the receiver to keep the content available as long as the proxy lives, and calls endContentAccess() when the proxy is deallocated.The wrapper object is otherwise a subclass of NSProxy and forwards messages to the original receiver object as an NSProxy does.This method can be used to hide an NSDiscardableContent object's content volatility by creating an object that responds to the same messages but holds the contents of the original receiver available as long as the created proxy lives. Thus hidden, the NSDiscardableContent object (by way of the proxy) can be given out to unsuspecting recipients of the object who would otherwise not know they might have to call beginContentAccess() and endContentAccess() around particular usages (specific to each NSDiscardableContent object) of the NSDiscardableContent object. |
|
public get |
This property is used by Cocoa’s scripting support classes. |
|
public get |
classDescription: NSClassDescription |
|
public get |
|
|
public get |
This method is invoked by NSCoder. |
|
public get |
The object will be encoded as if it were a member of the class. |
|
public get |
|
|
public get |
A subclass can override this method to remove bindings that are exposed by a superclass that are not appropriate for the subclass. |
|
public get |
|
|
public |
A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access. |
|
public get |
|
|
public get |
The methods of the object are exposed to the script environment. |
|
public get |
objectSpecifier: NSScriptObjectSpecifier |
|
public |
Returns a pointer that identifies information about all of the observers that are registered with the observed object. |
|
public |
An NSString-keyed dictionary of the receiver's scriptable properties. |
|
public |
A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen. |
|
public get |
|
|
public get |
|
|
public get |
webFrame: WebFrame Only implemented by containers that are based on the WebKit’s plug-in architecture. |
|
public get |
webPlugInContainerSelectionColor: CGColor The color should be used for any special drawing when the plug-in is selected. |
Method Summary
Public Methods | ||
public |
acceptsPreviewPanelControl(panel: QLPreviewPanel): boolean |
|
public |
accessibilityActionDescription(action: string): string this method was deprecated.
User interface classes must implement this method to return descriptions for all actions returned from accessibilityActionNames(). |
|
public |
this method was deprecated.
User interface classes must implement this method. |
|
public |
You can use this method to make complex controls more readily accessible to users. |
|
public |
accessibilityArrayAttributeCount(attribute: string): number If attribute is not an array, an exception is raised. |
|
public |
accessibilityArrayAttributeValues(attribute: string, index: number, maxCount: number): Object[] Note that this method does not take a range. |
|
public |
|
|
public |
this method was deprecated.
User interface classes must implement this method. |
|
public |
accessibilityAttributeValue(attribute: string): Object this method was deprecated.
User interface classes must implement this method. |
|
public |
accessibilityAttributeValueForParameter(attribute: string, parameter: Object): Object this method was deprecated.
If you implement this method, also implement accessibilityParameterizedAttributeNames(). |
|
public |
accessibilityDecrement(): void If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. |
|
public |
accessibilityElementAt(index: number): Object Returns the accessibility element at the specified index. |
|
public |
Returns the number of accessibility elements in the container. |
|
public |
Override accessibilityElementDidBecomeFocused if you need to know when an assistive technology has set its virtual focus on an accessibility element. |
|
public |
accessibilityElementDidLoseFocus(): void Override accessibilityElementDidLoseFocus if you need to know when an assistive technology has removed its virtual focus from an accessibility element. |
|
public |
Returns a Boolean value indicating whether an assistive technology is focused on the accessibility element. |
|
public |
accessibilityHitTest(point: CGPoint): Object You can assume that the specified point has already been determined to lie within the accessibility element's frame. Override this method to do deeper hit-testing by identifying which child element, if any, contains the point. NSMatrix, for example, identifies which of its cells contains the point and propagates the hit-test to it. If the specified point is not contained within one of the accessibility element's children, either return self or, if available, invoke the superclass's implementation. The default NSView and NSCell implementations test whether the accessibility element is an ignored element and, if it is, return the receiver's first unignored parent; otherwise they return self. |
|
public |
accessibilityIncrement(): void If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. |
|
public |
accessibilityIndexOfChild(child: Object): number Returns the index of the specified accessibility child in the parent. |
|
public |
accessibilityIsAttributeSettable(attribute: string): boolean this method was deprecated.
User interface classes must implement this method. |
|
public |
this method was deprecated.
When asking for an object's children, do not include ignored children; instead, replace the ignored children with their own unignored children. The same applies when asking for an object's parent: skip the ignored parent and treat the first unignored ancestor as the real parent. |
|
public |
this method was deprecated.
If you implement this method, also implement accessibilityAttributeValue(_:forParameter:). |
|
public |
accessibilityPerformAction(action: string): void this method was deprecated.
User interface classes must implement this method to handle all the actions returned from accessibilityActionNames(). |
|
public |
Implement this method on an element or containing view that can be revealed modally or in a hierarchy. |
|
public |
The exact action performed by this method depends your app, typically toggling the most important state of the app. |
|
public |
accessibilityScroll(direction: UIAccessibilityScrollDirection): boolean Implement this method if a view in the view hierarchy supports a scroll by page action.If the scrolling action succeeds for the specified direction, return true and post the UIAccessibilityPageScrolledNotification notification. |
|
public |
accessibilitySetOverrideValueForAttribute(value: Object, attribute: string): boolean this method was deprecated.
This method is for changing the set of attributes on an instance, as an alternative to subclassing.This method works only on objects whose class already implements the NSAccessibility protocol. |
|
public |
accessibilitySetValueForAttribute(value: Object, attribute: string): void this method was deprecated.
User interface classes must implement this method if any of its attributes are settable. |
|
public |
See Table 1The documentation for property-list constants for the properties for person and group records. |
|
public |
addObserverForKeyPath(observer: NSObject, keyPath: string, options: NSKeyValueObservingOptions, context: Object): void Neither the object receiving this message, nor observer, are retained. |
|
public |
applicationDelegateHandlesKey(sender: NSApplication, key: string): boolean The method should return true if the delegate for the app sender handles the key specified by key, which means it can get or set the scriptable property or element that corresponds to that key. |
|
public |
attemptRecoveryFromErrorOptionIndex(error: Error, recoveryOptionIndex: number): boolean Invoked when an error alert is been presented to the user in an application-modal dialog, and the user has selected an error recovery option specified by error. |
|
public |
authorizationViewCreatedAuthorization(view: SFAuthorizationView): void Sent to the delegate to indicate the authorization object has been created or changed. |
|
public |
authorizationViewDidAuthorize(view: SFAuthorizationView): void Sent to the delegate to indicate the user was authorized and the authorization view was changed to unlocked. |
|
public |
authorizationViewDidDeauthorize(view: SFAuthorizationView): void Sent to the delegate to indicate the user was deauthorized and the authorization view was changed to locked. |
|
public |
authorizationViewDidHide(view: SFAuthorizationView): void This delegate method, if present, is called whenever the isHidden method is called to show or hide the view. |
|
public |
authorizationViewReleasedAuthorization(view: SFAuthorizationView): void This method is called after deauthorization has been approved (either you called the deauthorize: method, or the user clicked an open lock icon and the authorizationViewShouldDeauthorize: delegate method did not cancel the operation), and before the user is deauthorized (that is, before the authorizationViewDidDeauthorize: delegate method is called). |
|
public |
authorizationViewShouldDeauthorize(view: SFAuthorizationView): number The delegate can react to this before deauthorization happens and avoid it by returning false. |
|
public |
awakeAfterUsing(aDecoder: NSCoder): Object You can use this method to eliminate redundant objects created by the coder. |
|
public |
awakeFromNib(): void The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized. |
|
public |
beginPreviewPanelControl(panel: QLPreviewPanel): void |
|
public |
bindToWithKeyPath(binding: string, observable: Object, keyPath: string, options: Map<string, Object>): void Establishes a binding between a given property of the receiver and the property of a given object specified by a given key path. |
|
public |
candidates(sender: Object): Object[] An input method should look up its currently composed string and return a list of candidate strings that that string might map to. |
|
public |
certificatePanelShowHelp(sender: SFCertificatePanel): number You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. |
|
public |
changeColor(sender: Object): void When the user selects a color in an NSColorPanel object, the panel sends a changeColor(_:) action message to the first responder. |
|
public |
changeFont(sender: Object): void Generally this change is because the user changed the font either in the selection of a rich text field or in a whole plain text field. |
|
public |
chooseIdentityPanelShowHelp(sender: SFChooseIdentityPanel): number You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. |
|
public |
classForAnnotationClass(annotationClass: Object): Object this method was deprecated.
|
|
public |
this method was deprecated.
|
|
public |
coerceValueForKey(value: Object, key: string): Object The method coerceValueFor<Key>: is used if it exists. |
|
public |
commitComposition(sender: Object): void If an input method implements this method, it is called when the client wants to end the composition session immediately. |
|
public |
A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error. |
|
public |
commitEditingAndReturnError(): void During autosaving, commit editing may fail, due to a pending edit. |
|
public |
commitEditingWithDelegateDidCommit(delegate: Object, didCommitSelector: function, contextInfo: Object): void The receiver must have been registered as the editor of an object using objectDidBeginEditing:, and has not yet been unregistered by a subsequent invocation of objectDidEndEditing:. |
|
public |
composedString(sender: Object): Object A composed string refers to the buffer that an input method typically maintains to mirror the text contained in the active inline area. |
|
public |
compositionParameterViewDidChangeParameterWithKey(parameterView: QCCompositionParameterView, portKey: string): void Called after an input parameter in the composition parameter view has been edited. |
|
public |
compositionParameterViewShouldDisplayParameterWithKeyAttributes(parameterView: QCCompositionParameterView, portKey: string, portAttributes: Map<AnyHashable, Object>): boolean Allows you to define which composition parameters are visible in the user interface when the composition parameter view refreshes. |
|
public |
compositionPickerViewDidSelect(pickerView: QCCompositionPickerView, composition: QCComposition): void Quartz Composer invokes this method when the selected composition in the composition picker view changes. |
|
public |
compositionPickerViewDidStartAnimating(pickerView: QCCompositionPickerView): void Quartz Composer invokes this method when the composition picker view starts animating a composition. |
|
public |
compositionPickerViewWillStopAnimating(pickerView: QCCompositionPickerView): void Quartz Composer invokes this method whenever the composition picker view stops animating a composition. |
|
public |
controlTextDidBeginEditing(obj: Notification): void This method is invoked when the user begins editing text in a control such as a text field or a form field. |
|
public |
controlTextDidChange(obj: Notification): void This method is invoked when text in a control such as a text field or form changes. |
|
public |
controlTextDidEndEditing(obj: Notification): void This method is invoked when the user stops editing text in a control such as a text field or form. |
|
public |
This is a convenience method for classes that adopt the NSCopying protocol. |
|
public |
copyScriptingValueForKeyWithProperties(value: Object, key: string, properties: Map<string, Object>): Object You can override the copyScriptingValue method to take more control when your application is sent a duplicate command. |
|
public |
dictionaryWithValuesForKeys(keys: string[]): Map<string, Object> The default implementation invokes value(forKey:) for each key in keys and substitutes NSNull values in the dictionary for returned nil values. |
|
public |
didChangeValueForKey(key: string): void Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key has just changed. |
|
public |
didChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void Use this method when implementing key-value observer compliance manually. |
|
public |
didChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void Use this method when implementing key-value-observing compliance manually.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
didCommandByClient(aSelector: function, sender: Object): boolean This method is called when the system binds a key down event to an action method. |
|
public |
didMatchString(instance: PDFSelection): void Called for every match found during a find operation. |
|
public |
discardEditing(): void Causes the receiver to discard any changes, restoring the previous values. |
|
public |
documentDidBeginDocumentFind(notification: Notification): void Called when the PDFDocumentDidBeginFindNotification notification is posted. |
|
public |
documentDidBeginPageFind(notification: Notification): void Called when the PDFDocumentDidBeginPageFindNotification notification is posted. |
|
public |
documentDidEndDocumentFind(notification: Notification): void Called when the PDFDocumentDidEndFindNotification notification is posted. |
|
public |
documentDidEndPageFind(notification: Notification): void Called when the PDFDocumentDidEndPageFindNotification notification is posted. |
|
public |
documentDidFindMatch(notification: Notification): void Called when the PDFDocumentDidFindMatchNotification notification is posted. |
|
public |
documentDidUnlock(notification: Notification): void Called when the PDFDocumentDidUnlockNotification notification is posted. |
|
public |
doesContain(object: Object): boolean Currently, doesContain(_:) messages are never sent to any object from within Cocoa itself. |
|
public |
doesNotRecognizeSelector(aSelector: function): void The runtime system invokes this method whenever an object receives an aSelector message it can’t respond to or forward. |
|
public |
endPreviewPanelControl(panel: QLPreviewPanel): void |
|
public |
exceptionHandlerShouldHandleMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should handle a given exception. |
|
public |
exceptionHandlerShouldLogExceptionMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should log a given exception. |
|
public |
fileManagerShouldProceedAfterError(fm: FileManager, errorInfo: Map<AnyHashable, Object>): boolean this method was deprecated.
An NSFileManager object, manager, sends this message for each error it encounters when copying, moving, removing, or linking files or directories. |
|
public |
fileManagerWillProcessPath(fm: FileManager, path: string): void this method was deprecated.
You can implement this method in your handler to monitor file operations. |
|
public |
fileTransferServicesAbortCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesConnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesCopyRemoteFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesCopyRemoteFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void |
|
public |
fileTransferServicesCreateFolderCompleteErrorFolder(inServices: OBEXFileTransferServices, inError: OBEXError, inFolderName: string): void |
|
public |
fileTransferServicesDisconnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesFilePreparationCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesPathChangeCompleteErrorFinalPath(inServices: OBEXFileTransferServices, inError: OBEXError, inPath: string): void |
|
public |
fileTransferServicesRemoveItemCompleteErrorRemovedItem(inServices: OBEXFileTransferServices, inError: OBEXError, inItemName: string): void |
|
public |
fileTransferServicesRetrieveFolderListingCompleteErrorListing(inServices: OBEXFileTransferServices, inError: OBEXError, inListing: Object[]): void |
|
public |
fileTransferServicesSendFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesSendFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void |
|
public |
finalize(): void this method was deprecated.
The garbage collector invokes this method on the receiver before disposing of the memory it uses. |
|
public |
finalizeForWebScript(): void This method is invoked on objects exposed to the scripting environment just before the scripting environment is reset. |
|
public |
fontManagerWillIncludeFont(sender: Object, fontName: string): boolean this method was deprecated.
In macOS versions 10.2 and earlier, this method is invoked repeatedly as necessary whenever the Font panel needs updating, such as when the Font panel is first loaded, and when the user selects a family name to see which typefaces in that family are available. |
|
public |
forwardingTargetFor(aSelector: function): Object If an object implements (or inherits) this method, and returns a non-nil (and non-self) result, that returned object is used as the new receiver object and the message dispatch resumes to that new object. |
|
public |
handleClient(event: NSEvent, sender: Object): boolean Handles key down and mouse events. |
|
public |
imageBrowserBackgroundWasRightClickedWith(aBrowser: IKImageBrowserView, event: NSEvent): void This method signals that the user either right-clicked the background or left-clicked it with the Alt key pressed. |
|
public |
imageBrowserCellWasDoubleClickedAt(aBrowser: IKImageBrowserView, index: number): void This method signals that the user double-clicked an item in the image browser view. |
|
public |
imageBrowserCellWasRightClickedAtWith(aBrowser: IKImageBrowserView, index: number, event: NSEvent): void This method signals that the user either right-clicked an item in the browser or left-clicked the item with the Alt key pressed. |
|
public |
imageBrowserGroupAt(aBrowser: IKImageBrowserView, index: number): Map<AnyHashable, Object> This method is optional. |
|
public |
imageBrowserItemAt(aBrowser: IKImageBrowserView, index: number): Object Your data source must implement this method. |
|
public |
imageBrowserMoveItemsAtTo(aBrowser: IKImageBrowserView, indexes: Set, destinationIndex: number): boolean This method is optional. |
|
public |
imageBrowserRemoveItemsAt(aBrowser: IKImageBrowserView, indexes: Set): void This method is optional. |
|
public |
imageBrowserSelectionDidChange(aBrowser: IKImageBrowserView): void This method signals that the user changes the selection in the image browser view. |
|
public |
imageBrowserWriteItemsAtTo(aBrowser: IKImageBrowserView, itemIndexes: Set, pasteboard: NSPasteboard): number This method is optional. |
|
public |
Your data source must implement this method. |
|
public |
Your data source must implement this method. |
|
public |
This method is optional. |
|
public |
imageTitle(): string This method is optional. |
|
public |
Your data source must implement this method. |
|
public |
This method is optional. |
|
public |
indexOfAccessibilityElement(element: Object): number Returns the index of the specified accessibility element. |
|
public |
indicesOfObjectsByEvaluatingObjectSpecifier(specifier: NSScriptObjectSpecifier): number[] Containers that want to evaluate some specifiers on their own should implement this method. |
|
public |
infoForBinding(binding: string): Map<string, Object> This method is mostly for use by subclasses which want to analyze the existing bindings of an object. |
|
public |
inputTextClient(string: string, sender: Object): boolean An input method should implement this method when using key binding (that is, it implements didCommand(by:client:)). |
|
public |
inputTextKeyModifiersClient(string: string, keyCode: number, flags: number, sender: Object): boolean Receives Unicode, the key code that generated it, and any modifier flags. |
|
public |
insertValueAtInPropertyWithKey(value: Object, index: number, key: string): void The method insertIn<Key>:atIndex: is invoked if it exists. |
|
public |
insertValueInPropertyWithKey(value: Object, key: string): void The method insertIn<Key>: is used if it exists. |
|
public |
inverseForRelationshipKey(relationshipKey: string): string NSObject’s implementation of inverseForRelationshipKey: simply invokes [[self classDescription] inverseForRelationshipKey:relationshipKey]. |
|
public |
invokeDefaultMethodWithArguments(_arguments: Object[]): Object Executes when a script attempts to invoke a method on an exposed object directly. |
|
public |
invokeUndefinedMethodFromWebScriptWithArguments(name: string, _arguments: Object[]): Object This method is invoked when a script attempts to invoke a method not directly exported to the scripting environment. |
|
public |
isCaseInsensitiveLike(object: string): boolean Currently, isCaseInsensitiveLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject returns false. |
|
public |
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSEqualToComparison, an isEqual(to:) message may be sent to each potentially specified object, if neither the potentially specified object nor the object being tested against implements a scriptingIsEqual(to:) method.The default implementation for this method provided by NSObject returns true if an isEqualTo: message sent to the same object would return true. |
|
public |
isGreaterThan(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanComparison, an isGreaterThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThan(:) method and the object being tested against does not implement a scriptingIsLessThanOrEqual(to:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedDescending. |
|
public |
isGreaterThanOrEqualTo(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanOrEqualToComparison, anisGreaterThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsLessThan(_:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedSame or NSOrderedDescending. |
|
public |
isInstanceOf(aClass: Object): boolean |
|
public |
isLessThan(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanComparison, an isLessThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThan(:) method and the object being tested against does not implement a scriptingIsGreaterThanOrEqual(to:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending. |
|
public |
isLessThanOrEqualTo(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanOrEqualToComparison, an isLessThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsGreaterThan(_:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending or NSOrderedSame. |
|
public |
Currently, isLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns false. |
|
public |
isNotEqualTo(object: Object): boolean Currently, isNotEqual(to:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns true if an isEqual: message sent to the same object would return false. |
|
public |
layerShouldInheritContentsScaleFrom(layer: CALayer, newScale: number, window: NSWindow): boolean When a resolution change occurs for a given window, the system traverses the layer trees in that window to decide what action, if any, to take for each layer. |
|
public |
If the receiver is an instance, aSelector should refer to an instance method; if the receiver is a class, it should refer to a class method. |
|
public |
mutableArrayValueForKey(key: string): Array Objects added to the mutable array become related to the receiver, and objects removed from the mutable array become unrelated. |
|
public |
mutableArrayValueForKeyPath(keyPath: string): Array See mutableArrayValue(forKey:) for additional details. |
|
public |
This is a convenience method for classes that adopt the NSMutableCopying protocol. |
|
public |
Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. |
|
public |
mutableOrderedSetValueForKeyPath(keyPath: string): Set See mutableOrderedSetValue(forKey:) for additional details. |
|
public |
mutableSetValueForKey(key: string): Set Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. |
|
public |
mutableSetValueForKeyPath(keyPath: string): Set See mutableSetValue(forKey:) for additional details. |
|
public |
namesOfPromisedFilesDroppedAtDestination(dropDestination: string): string[] this method was deprecated.
This method is invoked when the drop has been accepted by the destination and the destination, in the case of another Cocoa application, invokes the NSDraggingInfo method namesOfPromisedFilesDropped(atDestination:). |
|
public |
newScriptingObjectOfForValueForKeyWithContentsValue(objectClass: Object, key: string, contentsValue: Object, properties: Map<string, Object>): Object You can override the newScriptingObjectOfClass method to take more control when your application is sent a make command. |
|
public |
numberOfGroupsInImageBrowser(aBrowser: IKImageBrowserView): number This method is optional. |
|
public |
numberOfItemsInImageBrowser(aBrowser: IKImageBrowserView): number Your data source must implement this method. |
|
public |
objectDidBeginEditing(editor: Object): void This message should be sent to the receiver when editor has uncommitted changes that can affect the receiver. |
|
public |
objectDidEndEditing(editor: Object): void This message should be sent to the receiver when editor has finished editing a property belonging to the receiver. |
|
public |
observeValueForKeyPathOf(keyPath: string, object: Object, change: Map<NSKeyValueChangeKey, Object>, context: Object): void For an object to begin sending change notification messages for the value at keyPath, you send it an addObserver(_:forKeyPath:options:context:) message, naming the observing object that should receive the messages. |
|
public |
optionDescriptionsForBinding(binding: string): NSAttributeDescription[] The NSAttributeDescription instances in the array are used by Interface Builder to build the options editor user interface of the bindings inspector.The option name displayed for the option in the bindings inspector is based on the value of the NSAttributeDescription method name. |
|
public |
originalString(sender: Object): string Return the a string that consists of the precomposed unicode characters. |
|
public |
pasteboardChangedOwner(sender: NSPasteboard): void Pasteboard owners only need to implement this method if they need to know when they have lost ownership.The owner is not able to read the contents of the pasteboard when responding to this method. |
|
public |
pasteboardProvideDataForType(sender: NSPasteboard, type: string): void The receiver should have been previously declared in a declareTypes(:owner:) message.The requested data should be written to sender using the setData(:forType:), setPropertyList(:forType:), or setString(:forType:) method. |
|
public |
performActionFor(person: ABPerson, identifier: string): void If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
performOnWithWaitUntilDone(aSelector: function, thr: Thread, arg: Object, wait: boolean): void You can use this method to deliver messages to other threads in your application. |
|
public |
performOnWithWaitUntilDoneModes(aSelector: function, thr: Thread, arg: Object, wait: boolean, array: string[]): void You can use this method to deliver messages to other threads in your application. |
|
public |
performSelectorInBackgroundWith(aSelector: function, arg: Object): void This method creates a new thread in your application, putting your application into multithreaded mode if it was not already. |
|
public |
performSelectorOnMainThreadWithWaitUntilDone(aSelector: function, arg: Object, wait: boolean): void You can use this method to deliver messages to the main thread of your application. |
|
public |
performSelectorOnMainThreadWithWaitUntilDoneModes(aSelector: function, arg: Object, wait: boolean, array: string[]): void You can use this method to deliver messages to the main thread of your application. |
|
public |
performWithAfterDelay(aSelector: function, anArgument: Object, delay: number): void This method sets up a timer to perform the aSelector message on the current thread’s run loop. |
|
public |
performWithAfterDelayInModes(aSelector: function, anArgument: Object, delay: number, modes: RunLoopMode[]): void This method sets up a timer to perform the aSelector message on the current thread’s run loop. |
|
public |
prepareForInterfaceBuilder(): void When Interface Builder instantiates a class with the IB_DESIGNABLE attribute, it calls this method to let the resulting object know that it was created at design time. |
|
public |
provideImageDataBytesPerRowOriginSizeUserInfo(data: Object, rowbytes: number, x: number, y: number, width: number, height: number, info: Object): void You can supply the image provider to these methods of the CIImage class: imageWithImageProvider:size::format:colorSpace:options: to create a CIImage object from image datainit(imageProvider:size:_:format:colorSpace:options:) to initialize an existing CIImage with dataYou initialize the given bitmap with the subregion specified by the arguments x, y, width, and height. |
|
public |
quartzFilterManagerDidAdd(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidModifyFilter(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidRemove(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidSelect(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
readLinkQualityForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCILinkQualityInfo>, error: IOReturn): void This delegate gets invoked when an read link quality command complete event occurs. |
|
public |
readRSSIForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCIRSSIInfo>, error: IOReturn): void This delegate gets invoked when an RSSI command complete event occurs. |
|
public |
removeObserverForKeyPath(observer: NSObject, keyPath: string): void It is an error to call removeObserver(:forKeyPath:) for an object that has not previously been registered as an observer.Be sure to invoke this method (or removeObserver(:forKeyPath:context:)) before any object specified in addObserver(_:forKeyPath:options:context:) is deallocated. |
|
public |
removeValueAtFromPropertyWithKey(index: number, key: string): void The method removeFrom<Key>AtIndex: is invoked if it exists. |
|
public |
replaceValueAtInPropertyWithKeyWithValue(index: number, key: string, value: Object): void The method replaceIn<Key>:atIndex: is invoked if it exists. |
|
public |
replacementObjectFor(aCoder: NSCoder): Object An object might encode itself into an archive, but encode a proxy for itself if it’s being encoded for distribution. |
|
public |
saveOptionsShouldShowUTType(saveOptions: IKSaveOptions, utType: string): boolean Called to determine if the specified uniform type identifier should be shown in the save panel. |
|
public |
scriptingBeginsWith(object: Object): boolean Returns true if, in a scripting comparison, the compared object matches the beginning of object. |
|
public |
scriptingContains(object: Object): boolean Returns true if, in a scripting comparison, the compared object contains object. |
|
public |
scriptingEndsWith(object: Object): boolean Returns true if, in a scripting comparison, the compared object matches the end of object. |
|
public |
scriptingIsEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is equal to object. |
|
public |
scriptingIsGreaterThan(object: Object): boolean Returns true if, in a scripting comparison, the compared object is greater than object. |
|
public |
scriptingIsGreaterThanOrEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is greater than or equal to object. |
|
public |
scriptingIsLessThan(object: Object): boolean Returns true if, in a scripting comparison, the compared object is less than object. |
|
public |
scriptingIsLessThanOrEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is less than or equal to object. |
|
public |
scriptingValueFor(objectSpecifier: NSScriptObjectSpecifier): Object You can override this method to customize the evaluation of object specifiers without requiring that the scripting container make up indexes for contained objects that don't naturally have indexes (as can be the case if you implement indicesOfObjects(byEvaluatingObjectSpecifier:) instead).Your override of this method doesn't need to also invoke any of the NSScriptCommand error signaling methods, though it can, to record very specific information. |
|
public |
setNilValueForKey(key: string): void Subclasses can override this method to handle the request in some other way, such as by substituting 0 or a sentinel value for nil and invoking setValue(_:forKey:) again or setting the variable directly. |
|
public |
setValueForKey(value: Object, key: string): void If key identifies a to-one relationship, relate the object specified by value to the receiver, unrelating the previously related object if there was one. |
|
public |
setValueForKeyPath(value: Object, keyPath: string): void The default implementation of this method gets the destination object for each relationship using value(forKey:), and sends the final object a setValue(_:forKey:) message.Special ConsiderationsWhen using this method, and the destination object does not implement an accessor for the value, the default behavior is for that object to retain value rather than copy or assign value. |
|
public |
setValueForUndefinedKey(value: Object, key: string): void Subclasses can override this method to handle the request in some other way. |
|
public |
setValuesForKeys(keyedValues: Map<string, Object>): void The default implementation invokes setValue(_:forKey:) for each key-value pair, substituting nil for NSNull values in keyedValues. |
|
public |
shouldEnableActionFor(person: ABPerson, identifier: string): boolean If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
textStorageDidProcessEditing(notification: Notification): void this method was deprecated.
|
|
public |
textStorageWillProcessEditing(notification: Notification): void this method was deprecated.
|
|
public |
If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
Removes a given binding between the receiver and a controller. |
|
public |
validModesForFontPanel(fontPanel: NSFontPanel): number The mode masks are defined in Mode Masks. |
|
public |
validateMenuItem(menuItem: NSMenuItem): boolean The object implementing this method must be the target of menuItem. |
|
public |
validateToolbarItem(item: NSToolbarItem): boolean NSToolbar only calls this method for image items.Note validateToolbarItem(_:) is called very frequently, so it must be efficient.If the receiver is the target for the actions of multiple toolbar items, it’s necessary to determine which toolbar item theItem refers to by testing the itemIdentifier.-(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; } -(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; } |
|
public |
validateValueForKey(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKey: string): void The default implementation of this method searches the class of the receiver for a validation method whose name matches the pattern validate<Key>:error:. |
|
public |
validateValueForKeyPath(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKeyPath: string): void The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a validateValue(_:forKey:) message to the final object.Handling Errors in Swift: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. |
|
public |
valueAtInPropertyWithKey(index: number, key: string): Object This actually works with a single-value key as well if index is 0. |
|
public |
valueClassForBinding(binding: string): Object This method is used by Interface Builder to determine the appropriate transformers for a binding. |
|
public |
valueForKey(key: string): Object The search pattern that valueForKey: uses to find the correct value to return is described in Accessor Search Patterns in Key-Value Coding Programming Guide. |
|
public |
valueForKeyPath(keyPath: string): Object The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a value(forKey:) message to the final object. |
|
public |
valueForUndefinedKey(key: string): Object Subclasses can override this method to return an alternate value for undefined keys. |
|
public |
valueWithNameInPropertyWithKey(name: string, key: string): Object The method valueIn<Key>WithName: is used if it exists. |
|
public |
valueWithUniqueIDInPropertyWithKey(uniqueID: Object, key: string): Object The method valueIn<Key>WithUniqueID: is invoked if it exists. |
|
public |
viewStringForToolTipUserData(view: NSView, tag: NSToolTipTag, point: CGPoint, data: Object): string userData is additional information provided by the creator of the tool tip rectangle. |
|
public |
webPlugInContainerLoadInFrame(request: URLRequest, target: string): void If the frame specified by target is not found, a new window is opened, loaded with the URL request, and given the specified frame name. |
|
public |
webPlugInContainerShowStatus(message: string): void Tells the container to show a status message. |
|
public |
webPlugInDestroy(): void Typically, this method frees the memory and other resources used by the plug-in. |
|
public |
webPlugInInitialize(): void Tells the plug-in to perform one-time initialization. |
|
public |
webPlugInMainResourceDidFailWithError(error: Error): void This message is invoked when the underlying NSURLConnection object for the main resource sends the connection:didFailWithError: message to its delegate. |
|
public |
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connectionDidFinishLoading: message to its delegate. |
|
public |
webPlugInMainResourceDidReceive(response: URLResponse): void This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate. |
|
public |
webPlugInSetIsSelected(isSelected: boolean): void This may be used, for example, to change the plug-in’s appearance when it is selected by the user. |
|
public |
webPlugInStart(): void The plug-in usually begins its primary task (such as drawing, playing sounds, or animating) in this method. |
|
public |
webPlugInStop(): void This method may be called more than once, provided that the application has already called webPlugInInitialize() and that each call to this method is preceded by a call to webPlugInStart(). |
|
public |
willChangeValueForKey(key: string): void Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key is about to change.The change type of this method is NSKeyValueChangeSetting.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:) must be invoked with the same parameter. |
|
public |
willChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void Use this method when implementing key-value observer compliance manually.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:withSetMutation:using:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
willChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void Use this method when implementing key-value-observing compliance manually.ImportantAfter the values have been changed, a corresponding didChange(_:valuesAt:forKey:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
workflowControllerDidError(controller: AMWorkflowController, error: Error): void Invoked when the receiver's workflow encounters an error. |
|
public |
workflowControllerDidRun(controller: AMWorkflowController, action: AMAction): void Invoked when an action in the receiver's workflow is finished running. |
|
public |
workflowControllerDidStop(controller: AMWorkflowController): void Tells the delegate that the workflow controller object has stopped. |
|
public |
workflowControllerWillRun(controller: AMWorkflowController, action: AMAction): void Invoked when an action in the receiver's workflow is about to run. |
|
public |
workflowControllerWillStop(controller: AMWorkflowController): void Tells the delegate that the workflow controller object is about to stop. |
Static Public Members
public static get accessInstanceVariablesDirectly: boolean source
The default returns true. Subclasses can override it to return false, in which case the key-value coding methods won’t access instance variables.
Static Public Methods
public static automaticallyNotifiesObserversForKey(key: string): boolean source
The default implementation returns true. Starting in OS X 10.5, the default implementation of this method searches the receiving class for a method whose name matches the pattern +automaticallyNotifiesObserversOf<Key>, and returns the result of invoking that method if it is found. Any found methods must return BOOL. If no such method is found true is returned.
Params:
Name | Type | Attribute | Description |
key | string |
public static cancelPreviousPerformRequestsWithTarget(aTarget: Object): void source
All perform requests having the same target aTarget are canceled. This method removes perform requests only in the current run loop, not all run loops.
Params:
Name | Type | Attribute | Description |
aTarget | Object | The target for requests previously registered with the perform(_:with:afterDelay:) instance method. |
Return:
void |
public static cancelPreviousPerformRequestsWithTargetSelectorObject(aTarget: Object, aSelector: function, anArgument: Object): void source
All perform requests are canceled that have the same target as aTarget, argument as anArgument, and selector as aSelector. This method removes perform requests only in the current run loop, not all run loops.
Params:
Name | Type | Attribute | Description |
aTarget | Object | The target for requests previously registered with the perform(_:with:afterDelay:) instance method |
|
aSelector | function | The Selector for requests previously registered with the perform(_:with:afterDelay:) instance method. |
|
anArgument | Object |
|
The argument for requests previously registered with the perform(:with:afterDelay:) instance method. Argument equality is determined using isEqual(:), so the value need not be the same object that was passed originally. Pass nil to match a request for nil that was originally passed as the argument. |
Return:
void |
public static classFallbacksForKeyedArchiver(): string[] source
NSKeyedArchiver calls this method and stores the result inside the archive. If the actual class of an object doesn’t exist at the time of unarchiving, NSKeyedUnarchiver goes through the stored list of classes and uses the first one that does exists as a substitute class for decoding the object. The default implementation of this method returns nil.You can use this method if you introduce a new class into your application to provide some backwards compatibility in case the archive will be read on a system that does not have that class. Sometimes there may be another class which may work nearly as well as a substitute for the new class, and the archive keys and archived state for the new class can be carefully chosen (or compatibility written out) so that the object can be unarchived as the substitute class if necessary.
public static classForKeyedUnarchiver(): Object source
During keyed unarchiving, instances of the receiver will be decoded as members of the returned class. This method overrides the results of the decoder’s class and instance name to class encoding tables.
public static conformsTo(protocol: Object): boolean source
A class is said to “conform to” a protocol if it adopts the protocol or inherits from another class that adopts it. Protocols are adopted by listing them within angle brackets after the interface declaration. For example, here MyClass adopts the (fictitious) AffiliationRequests and Normalization protocols:@interface MyClass : NSObject <AffiliationRequests, Normalization> A class also conforms to any protocols that are incorporated in the protocols it adopts or inherits. Protocols incorporate other protocols in the same way classes adopt them. For example, here the AffiliationRequests protocol incorporates the Joining protocol:@protocol AffiliationRequests <Joining> If a class adopts a protocol that incorporates another protocol, it must also implement all the methods in the incorporated protocol or inherit those methods from a class that adopts it.This method determines conformance solely on the basis of the formal declarations in header files, as illustrated above. It doesn’t check to see whether the methods declared in the protocol are actually implemented—that’s the programmer’s responsibility.The protocol required as this method’s argument can be specified using the @protocol() directive:BOOL canJoin = [MyClass conformsToProtocol:@protocol(Joining)];
Params:
Name | Type | Attribute | Description |
protocol | Object |
public static defaultPlaceholderForMarkerWithBinding(marker: Object, binding: string): Object source
The marker can be nil or one of the constants described in Selection Markers.
public static description(): string source
The debugger’s print-object command invokes this method to produce a textual description of an object.NSObject's implementation of this method simply prints the name of the class.
public static exposeBinding(binding: string): void source
The bound property will be accessed using key-value-coding compliant methods. This method is typically invoked in the class’s initialize implementation.Bindings exposed using exposeBinding will be exposed automatically in exposedBindings unless that method explicitly filters them out, for example in subclasses.
Params:
Name | Type | Attribute | Description |
binding | string | The key path for the property to be exposed. |
Return:
void |
public static initWithCoder(coder: *): * source
Params:
Name | Type | Attribute | Description |
coder | * |
Return:
* |
public static initialize(): void source
The runtime sends initialize() to each class in a program just before the class, or any class that inherits from it, is sent its first message from within the program. Superclasses receive this message before their subclasses.The runtime sends the initialize() message to classes in a thread-safe manner. That is, initialize() is run by the first thread to send a message to a class, and any other thread that tries to send a message to that class will block until initialize() completes.The superclass implementation may be called multiple times if subclasses do not implement initialize()—the runtime will call the inherited implementation—or if subclasses explicitly call [super initialize]. If you want to protect yourself from being run multiple times, you can structure your implementation along these lines:+ (void)initialize { if (self == [ClassName self]) { // ... do the initialization ... } } Because initialize() is called in a blocking manner, it’s important to limit method implementations to the minimum amount of work necessary possible. Specifically, any code that takes locks that might be required by other classes in their initialize() methods is liable to lead to deadlocks. Therefore, you should not rely on initialize() for complex initialization, and should instead limit it to straightforward, class local initialization.Special Considerationsinitialize() is invoked only once per class. If you want to perform independent initialization for the class and for categories of the class, you should implement load() methods.+ (void)initialize { if (self == [ClassName self]) { // ... do the initialization ... } }
Return:
void |
public static instanceMethodFor(aSelector: function): function source
An error is generated if instances of the receiver can’t respond to aSelector messages.Use this method to ask the class object for the implementation of instance methods only. To ask the class for the implementation of a class method, send the method(for:) instance method to the class instead.
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
A Selector that identifies the method for which to return the implementation address. The selector must be non-NULL and valid for the receiver. If in doubt, use the responds(to:) method to check before passing the selector to method(for:). |
public static instancesRespondTo(aSelector: function): boolean source
If aSelector messages are forwarded to other objects, instances of the class are able to receive those messages without error even though this method returns false.To ask the class whether it, rather than its instances, can respond to a particular message, send to the class instead the NSObject protocol instance method responds(to:).
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
A Selector. |
public static isKeyExcludedFromWebScript(name: UnsafePointer<Int8>): boolean source
The default value is true.
Params:
Name | Type | Attribute | Description |
name | UnsafePointer<Int8> |
|
The name of the attribute. |
public static isSelectorExcludedFromWebScript(selector: function): boolean source
Only methods with valid parameters and return types are exported to the WebKit JavaScript environment. The valid types are Objective-C objects and scalars. The default value is true.
Params:
Name | Type | Attribute | Description |
selector | function |
|
public static isSubclassOf(aClass: Object): boolean source
Returns a Boolean value that indicates whether the receiving class is a subclass of, or identical to, a given class.
Params:
Name | Type | Attribute | Description |
aClass | Object | A class object. |
public static keyPathsForValuesAffectingValueForKey(key: string): Set<String> source
When an observer for the key is registered with an instance of the receiving class, key-value observing itself automatically observes all of the key paths for the same instance, and sends change notifications for the key to the observer when the value for any of those key paths changes.The default implementation of this method searches the receiving class for a method whose name matches the pattern +keyPathsForValuesAffecting<Key>, and returns the result of invoking that method if it is found. Any such method must return an NSSet. If no such method is found, an NSSet that is computed from information provided by previous invocations of the now-deprecated setKeys:triggerChangeNotificationsForDependentKey: method is returned, for backward binary compatibility.You can override this method when the getter method of one of your properties computes a value to return using the values of other properties, including those that are located by key paths. Your override should typically call super and return a set that includes any members in the set that result from doing that (so as not to interfere with overrides of this method in superclasses).NoteYou must not override this method when you add a computed property to an existing class using a category, overriding methods in categories is unsupported. In that case, implement a matching +keyPathsForValuesAffecting<Key> to take advantage of this mechanism.
Params:
Name | Type | Attribute | Description |
key | string | The key whose value is affected by the key paths. |
public static load(): void source
The load() message is sent to classes and categories that are both dynamically loaded and statically linked, but only if the newly loaded class or category implements a method that can respond.The order of initialization is as follows:All initializers in any framework you link to.All +load methods in your image.All C++ static initializers and C/C++ attribute(constructor) functions in your image.All initializers in frameworks that link to you.In addition:A class’s +load method is called after all of its superclasses’ +load methods.A category +load method is called after the class’s own +load method.In a custom implementation of load() you can therefore safely message other unrelated classes from the same image, but any load() methods implemented by those classes may not have run yet.ImportantCustom implementations of the load method for Swift classes bridged to Objective-C are not called automatically.
Return:
void |
public static resolveClassMethod(sel: function): boolean source
This method allows you to dynamically provide an implementation for a given selector. See resolveInstanceMethod(_:) for further discussion.
Params:
Name | Type | Attribute | Description |
sel | function |
|
public static resolveInstanceMethod(sel: function): boolean source
This method and resolveClassMethod(_:) allow you to dynamically provide an implementation for a given selector.An Objective-C method is simply a C function that take at least two arguments—self and _cmd. Using the classaddMethod(:::_:) function, you can add a function to a class as a method. Given the following function:void dynamicMethodIMP(id self, SEL _cmd) { // implementation .... } you can use resolveInstanceMethod: to dynamically add it to a class as a method (called resolveThisMethodDynamically) like this:+ (BOOL) resolveInstanceMethod:(SEL)aSEL { if (aSEL == @selector(resolveThisMethodDynamically)) { class_addMethod([self class], aSEL, (IMP) dynamicMethodIMP, "v@:"); return YES; } return [super resolveInstanceMethod:aSel]; } Special ConsiderationsThis method is called before the Objective-C forwarding mechanism is invoked. If responds(to:) or instancesRespond(to:) is invoked, the dynamic method resolver is given the opportunity to provide an IMP for the given selector first.void dynamicMethodIMP(id self, SEL _cmd) { // implementation .... }
- (BOOL) resolveInstanceMethod:(SEL)aSEL { if (aSEL == @selector(resolveThisMethodDynamically)) { class_addMethod([self class], aSEL, (IMP) dynamicMethodIMP, "v@:"); return YES; } return [super resolveInstanceMethod:aSel]; }
Params:
Name | Type | Attribute | Description |
sel | function |
|
public static setDefaultPlaceholderForMarkerWithBinding(placeholder: Object, marker: Object, binding: string): void source
The marker can be nil or one of the constants described in Selection Markers.
Return:
void |
public static setVersion(aVersion: number): void source
The version number is helpful when instances of the class are to be archived and reused later. The default version is 0.Special ConsiderationsThe version number applies to NSArchiver/NSUnarchiver, but not to NSKeyedArchiver/NSKeyedUnarchiver. A keyed archiver does not encode class version numbers.
Params:
Name | Type | Attribute | Description |
aVersion | number | The version number for the receiver. |
Return:
void |
public static version(): number source
If no version has been set, the default is 0. Version numbers are needed for decoding or unarchiving, so older versions of an object can be detected and decoded correctly.Caution should be taken when obtaining the version from within an NSCoding protocol or other methods. Use the class name explicitly when getting a class version number:version = [MyClass version]; Don’t simply send version to the return value of class—a subclass version number may be returned instead.Special ConsiderationsThe version number applies to NSArchiver/NSUnarchiver, but not to NSKeyedArchiver/NSKeyedUnarchiver. A keyed archiver does not encode class version numbers.version = [MyClass version];
public static webScriptNameFor(selector: function): string source
It is your responsibility to ensure that the returned name is unique to the script invoking this method. If this method returns nil or you do not implement it, the default name for the selector is constructed as follows: A colon (“:”) in the Objective-C selector is replaced by an underscore (“_”).An underscore in the Objective-C selector is prefixed with a dollar sign (“$”).A dollar sign in the Objective-C selector is prefixed with another dollar sign.The following table shows examples of how the default name is constructed:Objective-C selectorDefault script name for selectorsetFlag:setFlag_setFlag:forKey:withAttributes:setFlag_forKey_withAttributes_propertiesForExample_Object:propertiesForExample$_Objectset$forKey:withDictionary:set$$$_$_forKey_withDictionary_Since the default construction for a method name can be confusing depending on its Objective-C name, you should implement this method and return a more human-readable name.Objective-C selectorDefault script name for selectorsetFlag:setFlag_setFlag:forKey:withAttributes:setFlag_forKey_withAttributes_propertiesForExample_Object:propertiesForExample$_Objectset$forKey:withDictionary:set$$$_$_forKeywithDictionary
Params:
Name | Type | Attribute | Description |
selector | function |
|
Public Constructors
public constructor() source
An init() message is coupled with an alloc (or allocWithZone:) message in the same line of code:SomeClass object = [[SomeClass alloc] init]; An object isn’t ready to be used until it has been initialized.The init() method defined in the NSObject class does no initialization; it simply returns self. In terms of nullability, callers can assume that the NSObject implemetation of init() does not return nil.In a custom implementation of this method, you must invoke super’s Initialization then initialize and return the new object. If the new object can’t be initialized, the method should return nil. For example, a hypothetical BuiltInCamera class might return nil from its init method if run on a device that has no camera.- (instancetype)init { self = [super init]; if (self) { // Initialize self } return self; } In some cases, a custom implementation of the init() method might return a substitute object. You must therefore always use the object returned by init(), and not the one returned by alloc or allocWithZone:, in subsequent code.SomeClass object = [[SomeClass alloc] init];
- (instancetype)init { self = [super init]; if (self) { // Initialize self } return self; }
Public Members
public [key]: * source
public accessibilityActivationPoint: CGPoint source
The activation point for the accessibility element, in screen coordinates.
public accessibilityCustomActions: UIAccessibilityCustomAction[] source
An array of custom actions to display along with the built-in actions.
public accessibilityCustomRotors: UIAccessibilityCustomRotor[] source
public accessibilityElements: Object[] source
An array of the accessibility elements in the container.
public accessibilityElementsHidden: boolean source
A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden.
public get accessibilityFocusedUIElement: Object source
You can assume that the search for the focus has already been narrowed down to the accessibility element. Override this method to do deeper searching by identifying which child element, if any, may have the focus. If a child element does not have the focus, either return self or, if available, invoke the superclass's implementation. The default NSView and NSCell implementations test whether the accessibility element is an ignored element and, if so, return the element’s first unignored parent; otherwise they return self
public accessibilityFrame: CGRect source
The frame of the accessibility element, in screen coordinates.
public accessibilityHint: string source
A brief description of the result of performing an action on the accessibility element, in a localized string.
public accessibilityLabel: string source
A succinct label that identifies the accessibility element, in a localized string.
public accessibilityLanguage: string source
The language in which to speak the accessibility element's label, value, and hint.
public accessibilityNavigationStyle: UIAccessibilityNavigationStyle source
The navigation style to apply to the object and its elements.
public get accessibilityNotifiesWhenDestroyed: boolean source
In macOS 10.9 and later, a custom accessibility object that is an NSObject subclass can post accessibility notifications if it meets the following criteria:The lifetime of the custom accessibility object must match the lifetime of the corresponding element in the app's UI.Typically, a custom accessibility object that acts as a proxy for an onscreen UI element gets autoreleased and deallocated immediately after the app responds to an accessibility request. Such an object can’t post accessibility notifications, because all registered observers get removed as soon as the object is deallocated. To correct this, an app must guarantee that a custom accessibility object remains allocated for as long as its corresponding UI element remains visible.The object must post the NSAccessibilityUIElementDestroyedNotification notification at the appropriate time. The appropriate time is most likely to be when the corresponding UI element is removed from the screen, but it can also be when the object itself is deallocated. The object must implement accessibilityNotifiesWhenDestroyed and return true.
public accessibilityTraits: UIAccessibilityTraits source
The combination of accessibility traits that best characterize the accessibility element.
public accessibilityValue: string source
The value of the accessibility element, in a localized string.
public accessibilityViewIsModal: boolean source
A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.
public get attributeKeys: string[] source
NSObject’s implementation of attributeKeys simply calls [[self classDescription] attributeKeys]. To make use of the default implementation, you must therefore implement and register a suitable class description—see NSClassDescription.
public get autoContentAccessingProxy: Object source
This property returns a proxy for the receiving object if the receiver adopts the NSDiscardableContent protocol and still has content that has not been discarded.The proxy calls beginContentAccess() on the receiver to keep the content available as long as the proxy lives, and calls endContentAccess() when the proxy is deallocated.The wrapper object is otherwise a subclass of NSProxy and forwards messages to the original receiver object as an NSProxy does.This method can be used to hide an NSDiscardableContent object's content volatility by creating an object that responds to the same messages but holds the contents of the original receiver available as long as the created proxy lives. Thus hidden, the NSDiscardableContent object (by way of the proxy) can be given out to unsuspecting recipients of the object who would otherwise not know they might have to call beginContentAccess() and endContentAccess() around particular usages (specific to each NSDiscardableContent object) of the NSDiscardableContent object.
public get classDescription: NSClassDescription source
public get classForCoder: Object source
This method is invoked by NSCoder. NSObject’s implementation returns the receiver’s class. The private subclasses of a class cluster substitute the name of their public superclass when being archived.
public get classForKeyedArchiver: Object source
The object will be encoded as if it were a member of the class. This property is overridden by the encoder class and instance name to class encoding tables. If this property is nil, the result of this property is ignored.
public get exposedBindings: string[] source
A subclass can override this method to remove bindings that are exposed by a superclass that are not appropriate for the subclass.
public isAccessibilityElement: boolean source
A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access.
public get objectForWebScript: Object source
The methods of the object are exposed to the script environment. Messages sent to the returned object will be invoked in the scripting environment. See the WebScripting Protocol Reference informal protocol for more details.
public get objectSpecifier: NSScriptObjectSpecifier source
public observationInfo: Object source
Returns a pointer that identifies information about all of the observers that are registered with the observed object.
public scriptingProperties: Map<string, Object> source
An NSString-keyed dictionary of the receiver's scriptable properties.
public shouldGroupAccessibilityChildren: boolean source
A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen.
public get webFrame: WebFrame source
Only implemented by containers that are based on the WebKit’s plug-in architecture.
public get webPlugInContainerSelectionColor: CGColor source
The color should be used for any special drawing when the plug-in is selected.
Public Methods
public acceptsPreviewPanelControl(panel: QLPreviewPanel): boolean source
Params:
Name | Type | Attribute | Description |
panel | QLPreviewPanel |
|
public accessibilityActionDescription(action: string): string source
User interface classes must implement this method to return descriptions for all actions returned from accessibilityActionNames(). A button, for example, might return the string "press” for the NSAccessibilityPressAction action. Subclasses should invoke the superclass's implementation, if it exists, to obtain the descriptions of any inherited actions.
Params:
Name | Type | Attribute | Description |
action | string | The action attribute. |
public accessibilityActionNames(): Object[] source
User interface classes must implement this method. Subclasses should invoke the superclass's implementation, if it exists, and append additional action names or remove unsupported actions. See Constants for some common action names.
public accessibilityActivate(): boolean source
You can use this method to make complex controls more readily accessible to users. The accessibility system calls this method when a VoiceOver user double taps the selected element. Your implementation of this method should activate the element and perform whatever other tasks it deems appropriate. For example, you might use the method to activate a control that requires a complex gesture and would be difficult for VoiceOver users to perform, possibly because the gesture has a different meaning when VoiceOver is running.After performing any tasks, return an appropriate Boolean value to indicate success or failure.
public accessibilityArrayAttributeCount(attribute: string): number source
If attribute is not an array, an exception is raised.
Params:
Name | Type | Attribute | Description |
attribute | string | The accessibility array attribute. |
public accessibilityArrayAttributeValues(attribute: string, index: number, maxCount: number): Object[] source
Note that this method does not take a range. The maximum count is the maximum desired number of items requested by an accessibility client. This number may be beyond the bounds of your array.
public accessibilityAttributeNames(): Object[] source
User interface classes must implement this method. Subclasses should invoke the superclass's implementation, if it exists, and append additional attributes or remove unsupported attributes. See Constants for lists of attribute names.
public accessibilityAttributeValue(attribute: string): Object source
User interface classes must implement this method. Subclasses should invoke the superclass's implementation, if it exists, if attribute is not implemented in the subclass.
Params:
Name | Type | Attribute | Description |
attribute | string | The name of the attribute. See Constants for lists of attribute names. |
public accessibilityAttributeValueForParameter(attribute: string, parameter: Object): Object source
If you implement this method, also implement accessibilityParameterizedAttributeNames().
public accessibilityDecrement(): void source
If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. Use this method to decrement the value of the element. For example, a UISlider object uses this method to decrement its value by an appropriate amount.
Return:
void |
public accessibilityElementAt(index: number): Object source
Returns the accessibility element at the specified index.
Params:
Name | Type | Attribute | Description |
index | number | The index of the accessibility element. |
public accessibilityElementCount(): number source
Returns the number of accessibility elements in the container.
public accessibilityElementDidBecomeFocused(): void source
Override accessibilityElementDidBecomeFocused if you need to know when an assistive technology has set its virtual focus on an accessibility element.
Return:
void |
public accessibilityElementDidLoseFocus(): void source
Override accessibilityElementDidLoseFocus if you need to know when an assistive technology has removed its virtual focus from an accessibility element. Note that accessibilityElementDidLoseFocus is sent before accessibilityElementDidBecomeFocused().
Return:
void |
public accessibilityElementIsFocused(): boolean source
Returns a Boolean value indicating whether an assistive technology is focused on the accessibility element.
public accessibilityHitTest(point: CGPoint): Object source
You can assume that the specified point has already been determined to lie within the accessibility element's frame. Override this method to do deeper hit-testing by identifying which child element, if any, contains the point. NSMatrix, for example, identifies which of its cells contains the point and propagates the hit-test to it. If the specified point is not contained within one of the accessibility element's children, either return self or, if available, invoke the superclass's implementation. The default NSView and NSCell implementations test whether the accessibility element is an ignored element and, if it is, return the receiver's first unignored parent; otherwise they return self.
Params:
Name | Type | Attribute | Description |
point | CGPoint | The point being hit-tested, in lower-left relative screen coordinates. |
public accessibilityIncrement(): void source
If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. Use this method to increment the value of the element. For example, a UISlider object uses this method to increment its value by an appropriate amount.
Return:
void |
public accessibilityIndexOfChild(child: Object): number source
Returns the index of the specified accessibility child in the parent.
Params:
Name | Type | Attribute | Description |
child | Object | The accessibility child of an object. |
public accessibilityIsAttributeSettable(attribute: string): boolean source
User interface classes must implement this method. Subclasses should invoke the superclass's implementation, if it exists, if attribute is not implemented in the subclass.
Params:
Name | Type | Attribute | Description |
attribute | string | The name of the attribute. See Constants for lists of attribute names. |
public accessibilityIsIgnored(): boolean source
When asking for an object's children, do not include ignored children; instead, replace the ignored children with their own unignored children. The same applies when asking for an object's parent: skip the ignored parent and treat the first unignored ancestor as the real parent. Likewise, when a hit-test or focus test is satisfied by an ignored element, use the element's first unignored ancestor (or descendant in certain cases, such as single-celled controls) instead.Ignored elements let you provide a simplified version of the view and object ownership hierarchies. Accessibility clients can bypass intermediate objects, letting users access the real user interface objects more quickly. For example, NSControl objects are ignored when they are single-celled; the visible parent-child relationship is between the control's parent (or a higher ancestor if the parent is ignored, too) and the control's cell.
public accessibilityParameterizedAttributeNames(): Object[] source
If you implement this method, also implement accessibilityAttributeValue(_:forParameter:).
public accessibilityPerformAction(action: string): void source
User interface classes must implement this method to handle all the actions returned from accessibilityActionNames(). Subclasses should invoke the superclass's implementation, if it exists, if action is not implemented in the subclass.
Params:
Name | Type | Attribute | Description |
action | string | The action to perform. |
Return:
void |
public accessibilityPerformEscape(): boolean source
Implement this method on an element or containing view that can be revealed modally or in a hierarchy. When a VoiceOver user performs a dismiss action, this method dismisses the view. For example, you might implement this method for a popover in order to give users a deliberate dismiss action to perform that closes the popover.
public accessibilityPerformMagicTap(): boolean source
The exact action performed by this method depends your app, typically toggling the most important state of the app. For example, in the Phone app it answers and ends phone calls, in the Music app it plays and pauses playback, in the Clock app it starts and stops a timer, and in the Camera app it takes a picture.
public accessibilityScroll(direction: UIAccessibilityScrollDirection): boolean source
Implement this method if a view in the view hierarchy supports a scroll by page action.If the scrolling action succeeds for the specified direction, return true and post the UIAccessibilityPageScrolledNotification notification. If the scrolling action fails, accessibilityScroll: is called on a parent view in the hierarchy.
Params:
Name | Type | Attribute | Description |
direction | UIAccessibilityScrollDirection | A constant that specifies the direction of the scrolling action. See UIAccessibilityScrollDirection for descriptions of valid constants. |
public accessibilitySetOverrideValueForAttribute(value: Object, attribute: string): boolean source
This method is for changing the set of attributes on an instance, as an alternative to subclassing.This method works only on objects whose class already implements the NSAccessibility protocol. If the specified attribute is already supported by the object, the value specified by this method wins.If the specified attribute does not exist, it is created outside the NSAccessibility protocol, so accessibilityAttributeNames still returns the old list, which does not contain the new attribute. Likewise, accessibilityAttributeValue does not return attributes created by the override process nor does it return their overridden values.The values of overridden attributes are not settable by accessibility clients.If you need to undo the effect of using this method, call it again, passing nil for the value.Ensure that you invoke this method on the actual object that represents the user interface element. For example, for NSButton, use the underlying NSButtonCell object. NSButton itself is ignored by accessibility.This method works only on an object representing a single user interface element. So, for example, you cannot use it when a single object represents multiple user interface elements, as with NSSegmentedCell, which has only a single object but provides user interface elements for each segment.
public accessibilitySetValueForAttribute(value: Object, attribute: string): void source
User interface classes must implement this method if any of its attributes are settable. Subclasses should invoke the superclass's implementation, if it exists, if attribute is not implemented in the subclass.
Return:
void |
public actionProperty(): string source
See Table 1The documentation for property-list constants for the properties for person and group records.
public addObserverForKeyPath(observer: NSObject, keyPath: string, options: NSKeyValueObservingOptions, context: Object): void source
Neither the object receiving this message, nor observer, are retained. An object that calls this method must also eventually call either the removeObserver(:forKeyPath:) or removeObserver(:forKeyPath:context:) method to unregister the observer when participating in KVO.
Params:
Name | Type | Attribute | Description |
observer | NSObject | The object to register for KVO notifications. The observer must implement the key-value observing method observeValue(forKeyPath:of:change:context:). |
|
keyPath | string | The key path, relative to the object receiving this message, of the property to observe. This value must not be nil. |
|
options | NSKeyValueObservingOptions |
|
A combination of the NSKeyValueObservingOptions values that specifies what is included in observation notifications. For possible values, see NSKeyValueObservingOptions. |
context | Object |
|
Arbitrary data that is passed to observer in observeValue(forKeyPath:of:change:context:). |
Return:
void |
public applicationDelegateHandlesKey(sender: NSApplication, key: string): boolean source
The method should return true if the delegate for the app sender handles the key specified by key, which means it can get or set the scriptable property or element that corresponds to that key. The app implements methods for each of the keys that it handles, where the method name matches the key.For example, a scriptable app that doesn’t use Cocoa’s document-based app architecture can implement this method to supply its own document ordering. Such an app might want to do this because the standard app delegate expects to work with a document-based app. The TextEdit app (whose source is distributed with macOS developer tools) provides the following implementation:return [key isEqualToString:@"orderedDocuments"]; TextEdit then implements the orderedDocuments method in its controller class to return an ordered list of documents. An app with its own window ordering might add a test for the key orderedWindows so that its delegate can provide its own version of orderedWindows.ImportantCocoa scripting does not invoke this method for script commands other than get or set. For information on working with other commands, see Script Commands in Cocoa Scripting Guide.return [key isEqualToString:@"orderedDocuments"];
Params:
Name | Type | Attribute | Description |
sender | NSApplication | The app object associated with the delegate. |
|
key | string | The key to be handled. |
public attemptRecoveryFromErrorOptionIndex(error: Error, recoveryOptionIndex: number): boolean source
Invoked when an error alert is been presented to the user in an application-modal dialog, and the user has selected an error recovery option specified by error.
public authorizationViewCreatedAuthorization(view: SFAuthorizationView): void source
Sent to the delegate to indicate the authorization object has been created or changed. If you have saved a copy of the authorization object for your own purposes, you should discard it and call authorization for a new authorization object.
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
Return:
void |
public authorizationViewDidAuthorize(view: SFAuthorizationView): void source
Sent to the delegate to indicate the user was authorized and the authorization view was changed to unlocked.
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
Return:
void |
public authorizationViewDidDeauthorize(view: SFAuthorizationView): void source
Sent to the delegate to indicate the user was deauthorized and the authorization view was changed to locked.
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
Return:
void |
public authorizationViewDidHide(view: SFAuthorizationView): void source
This delegate method, if present, is called whenever the isHidden method is called to show or hide the view.
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
Return:
void |
public authorizationViewReleasedAuthorization(view: SFAuthorizationView): void source
This method is called after deauthorization has been approved (either you called the deauthorize: method, or the user clicked an open lock icon and the authorizationViewShouldDeauthorize: delegate method did not cancel the operation), and before the user is deauthorized (that is, before the authorizationViewDidDeauthorize: delegate method is called).
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
Return:
void |
public authorizationViewShouldDeauthorize(view: SFAuthorizationView): number source
The delegate can react to this before deauthorization happens and avoid it by returning false. This delegate method is not called when you call the deauthorize: method.
Params:
Name | Type | Attribute | Description |
view | SFAuthorizationView |
|
public awakeAfterUsing(aDecoder: NSCoder): Object source
You can use this method to eliminate redundant objects created by the coder. For example, if after decoding an object you discover that an equivalent object already exists, you can return the existing object. If a replacement is returned, your overriding method is responsible for releasing the receiver. This method is invoked by NSCoder. NSObject’s implementation simply returns self.
Params:
Name | Type | Attribute | Description |
aDecoder | NSCoder | The decoder used to decode the receiver. |
public awakeFromNib(): void source
The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized. When an object receives an awakeFromNib message, it is guaranteed to have all its outlet and action connections already established.You must call the super implementation of awakeFromNib to give parent classes the opportunity to perform any additional initialization they require. Although the default implementation of this method does nothing, many UIKit classes provide non-empty implementations. You may call the super implementation at any point during your own awakeFromNib method.NoteDuring Interface Builder’s test mode, this message is also sent to objects instantiated from loaded Interface Builder plug-ins. Because plug-ins link against the framework containing the object definition code, Interface Builder is able to call their awakeFromNib method when present. The same is not true for custom objects that you create for your Xcode projects. Interface Builder knows only about the defined outlets and actions of those objects; it does not have access to the actual code for them.During the instantiation process, each object in the archive is unarchived and then initialized with the method befitting its type. Objects that conform to the NSCoding protocol (including all subclasses of UIView and UIViewController) are initialized using their initWithCoder: method. All objects that do not conform to the NSCoding protocol are initialized using their init method. After all objects have been instantiated and initialized, the nib-loading code reestablishes the outlet and action connections for all of those objects. It then calls the awakeFromNib method of the objects. For more detailed information about the steps followed during the nib-loading process, see Nib Files in Resource Programming Guide.ImportantBecause the order in which objects are instantiated from an archive is not guaranteed, your initialization methods should not send messages to other objects in the hierarchy. Messages to other objects can be sent safely from within an awakeFromNib method. Typically, you implement awakeFromNib for objects that require additional set up that cannot be done at design time. For example, you might use this method to customize the default configuration of any controls to match user preferences or the values in other controls. You might also use it to restore individual controls to some previous state of your application.
Return:
void |
public beginPreviewPanelControl(panel: QLPreviewPanel): void source
Params:
Name | Type | Attribute | Description |
panel | QLPreviewPanel |
|
Return:
void |
public bindToWithKeyPath(binding: string, observable: Object, keyPath: string, options: Map<string, Object>): void source
Establishes a binding between a given property of the receiver and the property of a given object specified by a given key path.
Params:
Name | Type | Attribute | Description |
binding | string | The key path for a property of the receiver previously exposed using the exposeBinding(_:) method. |
|
observable | Object | ||
keyPath | string | A key path to a property reachable from observableController. The elements in the path must be key-value observing compliant (see Key-Value Observing Programming Guide). |
|
options | Map<string, Object> |
|
A dictionary containing options for the binding, such as placeholder objects or an NSValueTransformer identifier as described in Constants. This value is optional—pass nil to specify no options. |
Return:
void |
public candidates(sender: Object): Object[] source
An input method should look up its currently composed string and return a list of candidate strings that that string might map to.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The client object requesting the candidates. |
public certificatePanelShowHelp(sender: SFCertificatePanel): number source
You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. If you are not implementing custom help, do not implement this method.
Params:
Name | Type | Attribute | Description |
sender | SFCertificatePanel |
|
The certificate panel for which to implement custom help. |
public changeColor(sender: Object): void source
When the user selects a color in an NSColorPanel object, the panel sends a changeColor(_:) action message to the first responder. You can override this method in any responder that needs to respond to a color change.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The NSColorPanel sending the message. |
Return:
void |
public changeFont(sender: Object): void source
Generally this change is because the user changed the font either in the selection of a rich text field or in a whole plain text field. Any object that contains a font the user can change must respond to the changeFont(:) message by sending a convert(:) message back to sender (an NSFontManager object) for each font in the selection. For more information, see Responding to Font Changes.Be aware that selectedFont at this point may return unpredictable results. The font in this property may not be the last font selected, or there may be multiple fonts selected at the time changeFont(:) is called. The use of selectedFont from within changeFont(:) is strongly discouraged.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The object that sent the message. |
Return:
void |
public chooseIdentityPanelShowHelp(sender: SFChooseIdentityPanel): number source
You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. If you are not implementing custom help, do not implement this method.
Params:
Name | Type | Attribute | Description |
sender | SFChooseIdentityPanel |
|
The choose identity panel for which to implement custom help. |
public classForAnnotationClass(annotationClass: Object): Object source
Params:
Name | Type | Attribute | Description |
annotationClass | Object |
public coerceValueForKey(value: Object, key: string): Object source
The method coerceValueFor<Key>: is used if it exists.
public commitComposition(sender: Object): void source
If an input method implements this method, it is called when the client wants to end the composition session immediately. A typical response would be to call the insertText method of the client and then clean up any per-session buffers and variables. After receiving this message an input method should consider the given composition session finished.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The client object requesting the input method to commit the composition. |
Return:
void |
public commitEditing(): boolean source
A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error.
public commitEditingAndReturnError(): void source
During autosaving, commit editing may fail, due to a pending edit. Rather than interrupt the user with an unexpected alert, this method provides the caller with the option to either present the error or fail silently, leaving the pending edit in place and the user's editing uninterrupted. In your implementation of this method, you should attempt to commit editing, but if there is a failure return false and in error an error object to be presented or ignored as appropriate. Handling Errors in Swift: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language (Swift 3.1) and Error Handling in Using Swift with Cocoa and Objective-C (Swift 3.1).
Return:
void |
Throw:
public commitEditingWithDelegateDidCommit(delegate: Object, didCommitSelector: function, contextInfo: Object): void source
The receiver must have been registered as the editor of an object using objectDidBeginEditing:, and has not yet been unregistered by a subsequent invocation of objectDidEndEditing:. When the committing has either succeeded or failed, send the following message to the specified object. The didCommitSelector method must have the following method signature: - (void)editor:(id)editor didCommit:(BOOL)didCommit contextInfo:(void )contextInfo If an error occurs while attempting to commit, for example if key-value coding validation fails, an implementation of this method should typically send the NSView in which editing is being done a presentError:modalForWindow:delegate:didRecoverSelector:contextInfo: message, specifying the view's containing window.- (void)editor:(id)editor didCommit:(BOOL)didCommit contextInfo:(void )contextInfo
Return:
void |
public composedString(sender: Object): Object source
A composed string refers to the buffer that an input method typically maintains to mirror the text contained in the active inline area. It is called the composed string to reflect the fact that the input method composed the string by converting the characters input by the user. In addition, using the term composed string makes it easier to differentiate between an input method buffer and the text in the active inline area that the user sees.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The client object requesting the string. |
public compositionParameterViewDidChangeParameterWithKey(parameterView: QCCompositionParameterView, portKey: string): void source
Called after an input parameter in the composition parameter view has been edited.
Params:
Name | Type | Attribute | Description |
parameterView | QCCompositionParameterView |
|
The composition parameter view in which the parameter changed. |
portKey | string |
|
A key for one of the composition parameters, which is provided to you by the Quartz Composer engine. |
Return:
void |
public compositionParameterViewShouldDisplayParameterWithKeyAttributes(parameterView: QCCompositionParameterView, portKey: string, portAttributes: Map<AnyHashable, Object>): boolean source
Allows you to define which composition parameters are visible in the user interface when the composition parameter view refreshes.
Params:
Name | Type | Attribute | Description |
parameterView | QCCompositionParameterView |
|
The composition parameter view in which the selection changed. |
portKey | string |
|
A key for one of the composition parameters, which is provided to you by the Quartz Composer engine. |
portAttributes | Map<AnyHashable, Object> |
|
A dictionary of the attributes that you want to display in the user interface. |
public compositionPickerViewDidSelect(pickerView: QCCompositionPickerView, composition: QCComposition): void source
Quartz Composer invokes this method when the selected composition in the composition picker view changes. Implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
pickerView | QCCompositionPickerView |
|
The composition picker view in which the selection changed. |
composition | QCComposition |
|
The selected composition or nil if the previously selected composition is no longer selected. |
Return:
void |
public compositionPickerViewDidStartAnimating(pickerView: QCCompositionPickerView): void source
Quartz Composer invokes this method when the composition picker view starts animating a composition. Implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
pickerView | QCCompositionPickerView |
|
The composition picker view in which the composition started animating. |
Return:
void |
public compositionPickerViewWillStopAnimating(pickerView: QCCompositionPickerView): void source
Quartz Composer invokes this method whenever the composition picker view stops animating a composition. Implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
pickerView | QCCompositionPickerView |
|
The composition picker view in which the composition stopped animating. |
Return:
void |
public controlTextDidBeginEditing(obj: Notification): void source
This method is invoked when the user begins editing text in a control such as a text field or a form field. The control posts a NSControlTextDidBeginEditing notification, and if the control’s delegate implements this method, it is automatically registered to receive the notification. Use the key @"NSFieldEditor" to obtain the field editor from the userInfo dictionary of the notification object. See controlTextDidEndEditing(:) for an explanation of why you may not always get one invocation of controlTextDidBeginEditing(:) for each invocation of controlTextDidEndEditing(_:).
Params:
Name | Type | Attribute | Description |
obj | Notification |
Return:
void |
public controlTextDidChange(obj: Notification): void source
This method is invoked when text in a control such as a text field or form changes. The control posts a NSControlTextDidChange notification, and if the control’s delegate implements this method, it is automatically registered to receive the notification. Use the key @"NSFieldEditor" to obtain the field editor from the userInfo dictionary of the notification object.
Params:
Name | Type | Attribute | Description |
obj | Notification |
Return:
void |
public controlTextDidEndEditing(obj: Notification): void source
This method is invoked when the user stops editing text in a control such as a text field or form. The control posts a NSControlTextDidEndEditing notification, and if the control’s delegate implements this method, it is automatically registered to receive the notification. Use the key @"NSFieldEditor" to obtain the field editor from the userInfo dictionary of the notification object. WarningIn some cases, such as when editing within an instance of NSOutlineView, this method may be invoked without a previous invocation of controlTextDidBeginEditing(_:). You will only get the controlTextDidBeginEditing: notification if the user actually types something, but you can get the controlTextDidEndEditing: notification if the user just double-clicks the field and then clicks outside the field, without typing.
Params:
Name | Type | Attribute | Description |
obj | Notification |
Return:
void |
public copy(): Object source
This is a convenience method for classes that adopt the NSCopying protocol. An exception is raised if there is no implementation for copy(with:).NSObject does not itself support the NSCopying protocol. Subclasses must support the protocol and implement the copy(with:) method. A subclass version of the copy(with:) method should send the message to super first, to incorporate its implementation, unless the subclass descends directly from NSObject.
public copyScriptingValueForKeyWithProperties(value: Object, key: string, properties: Map<string, Object>): Object source
You can override the copyScriptingValue method to take more control when your application is sent a duplicate command. This method is invoked on the prospective container of the copied object or objects. The properties are derived from the with properties parameter of the duplicate command. The returned objects or objects are then inserted into the container using key-value coding. When this method is invoked by Cocoa, neither the value nor the properties will have yet been coerced using the NSScriptKeyValueCoding method coerceValue(_:forKey:). For sdef-declared scriptability, however, the types of the passed-in objects reliably match the relevant sdef declarations.The default implementation of this method copies scripting objects by sending copyWithZone: to the object or objects specified by value. You override this method for situations where this is not sufficient, such as in Core Data applications, in which new objects must be initialized with [NSManagedObject initWithEntity:insertIntoManagedObjectContext:].
Params:
Name | Type | Attribute | Description |
value | Object | An object or objects to be copied. The type must match the type of the property identified by key. (See also the Discussion section.)For example, if the property is a to-many relationship, value will always be an array of objects to be copied, and this method must therefore return an array of objects. |
|
key | string | A key that identifies the relationship into which to insert the copied object or objects. |
|
properties | Map<string, Object> | The properties to be set in the copied object or objects. Derived from the "with properties" parameter of a duplicate command. (See also the Discussion section.) |
public dictionaryWithValuesForKeys(keys: string[]): Map<string, Object> source
The default implementation invokes value(forKey:) for each key in keys and substitutes NSNull values in the dictionary for returned nil values.
Params:
Name | Type | Attribute | Description |
keys | string[] | An array containing NSString objects that identify properties of the receiver. |
public didChangeValueForKey(key: string): void source
Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key has just changed. Calls to this method are always paired with a matching call to willChangeValue(forKey:).Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super.
Params:
Name | Type | Attribute | Description |
key | string | The name of the property that changed. |
Return:
void |
public didChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void source
Use this method when implementing key-value observer compliance manually. Calls to this method are always paired with a matching call to willChangeValue(forKey:withSetMutation:using:).Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super.
Return:
void |
public didChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void source
Use this method when implementing key-value-observing compliance manually.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. Calls to this method are always paired with a matching call to willChange(_:valuesAt:forKey:).
Return:
void |
public didCommandByClient(aSelector: function, sender: Object): boolean source
This method is called when the system binds a key down event to an action method. If you implement this method you should test if it is appropriate to call the action method before actually calling it, because calling the action method implies that you agree to handle the command. Suppose you have implemented a version of insertNewline: that terminates the conversion session and sends the fully converted text to the client. However, if you conversion buffer is empty, you want the application to receive the return key that triggered the call to insertNewline:. In that case, when didCommandBySelector:client: is called you should test your buffer before calling your implementation of insertNewline:. If the buffer is empty, return false to indicate that the return key should be passed on to the application. If the buffer is not empty, call insertNewline: and then return true as the result of didCommandBySelector:client:.
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
The action associated with the key down event. The selector can be an action specified in the input method dictionary of keys and actions (that is, an action specific to the input method) or one of the NSResponder action methods such as insertNewline: or deleteBackward:. By definition such action methods do not return a value. |
sender | Object |
|
The client object sending the key down event. |
public didMatchString(instance: PDFSelection): void source
Called for every match found during a find operation.
Params:
Name | Type | Attribute | Description |
instance | PDFSelection |
Return:
void |
public discardEditing(): void source
Causes the receiver to discard any changes, restoring the previous values.
Return:
void |
public documentDidBeginDocumentFind(notification: Notification): void source
Called when the PDFDocumentDidBeginFindNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public documentDidBeginPageFind(notification: Notification): void source
Called when the PDFDocumentDidBeginPageFindNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public documentDidEndDocumentFind(notification: Notification): void source
Called when the PDFDocumentDidEndFindNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public documentDidEndPageFind(notification: Notification): void source
Called when the PDFDocumentDidEndPageFindNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public documentDidFindMatch(notification: Notification): void source
Called when the PDFDocumentDidFindMatchNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public documentDidUnlock(notification: Notification): void source
Called when the PDFDocumentDidUnlockNotification notification is posted.
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public doesContain(object: Object): boolean source
Currently, doesContain(_:) messages are never sent to any object from within Cocoa itself. The default implementation for this method provided by NSObject returns true if the receiver is actually an NSArray object and an indexOfObjectIdentical(to:) message sent to the same object would return something other than NSNotFound.
Params:
Name | Type | Attribute | Description |
object | Object | The object to search for in the receiver. |
public doesNotRecognizeSelector(aSelector: function): void source
The runtime system invokes this method whenever an object receives an aSelector message it can’t respond to or forward. This method, in turn, raises an NSInvalidArgumentException, and generates an error message. Any doesNotRecognizeSelector(:) messages are generally sent only by the runtime system. However, they can be used in program code to prevent a method from being inherited. For example, an NSObject subclass might renounce the copy() or init() method by re-implementing it to include a doesNotRecognizeSelector(:) message as follows:- (id)copy { [self doesNotRecognizeSelector:_cmd]; } The _cmd variable is a hidden argument passed to every method that is the current selector; in this example, it identifies the selector for the copy method. This code prevents instances of the subclass from responding to copy messages or superclasses from forwarding copy messages—although responds(to:) will still report that the receiver has access to a copy method.If you override this method, you must call super or raise an invalidArgumentException exception at the end of your implementation. In other words, this method must not return normally; it must always result in an exception being thrown. - (id)copy { [self doesNotRecognizeSelector:_cmd]; }
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
A Selector that identifies a method not implemented or recognized by the receiver. |
Return:
void |
public endPreviewPanelControl(panel: QLPreviewPanel): void source
Params:
Name | Type | Attribute | Description |
panel | QLPreviewPanel |
|
Return:
void |
public exceptionHandlerShouldHandleMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean source
Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should handle a given exception.
Params:
Name | Type | Attribute | Description |
sender | NSExceptionHandler |
|
The NSExceptionHandler object sending the message. |
exception | NSException |
|
An NSException object describing the exception to be evaluated. |
aMask | number | The bit mask indicating the types of exceptions handled by the NSExceptionHandler object. See Logging and Handling Constants and System Hang Constants for descriptions of the possible enum constants. |
public exceptionHandlerShouldLogExceptionMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean source
Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should log a given exception.
Params:
Name | Type | Attribute | Description |
sender | NSExceptionHandler |
|
The NSExceptionHandler object sending the message. |
exception | NSException |
|
An NSException object describing the exception to be evaluated. |
aMask | number | The bit mask indicating the types of exceptions logged by the NSExceptionHandler object. See Logging and Handling Constants and System Hang Constants for descriptions of the possible enum constants. |
public fileManagerShouldProceedAfterError(fm: FileManager, errorInfo: Map<AnyHashable, Object>): boolean source
An NSFileManager object, manager, sends this message for each error it encounters when copying, moving, removing, or linking files or directories. The return value is passed back to the invoker of copyPath:toPath:handler:, movePath:toPath:handler:, removeFileAtPath:handler:, or linkPath:toPath:handler:. If an error occurs and your handler has not implemented this method, the invoking method automatically returns false.
Params:
Name | Type | Attribute | Description |
fm | FileManager | ||
errorInfo | Map<AnyHashable, Object> | A dictionary that contains two or three pieces of information (all NSString objects) related to the error:KeyValue@"Path"The path related to the error (usually the source path)@"Error"A description of the error@"ToPath" The destination path (not all errors) |
public fileManagerWillProcessPath(fm: FileManager, path: string): void source
You can implement this method in your handler to monitor file operations.
Params:
Name | Type | Attribute | Description |
fm | FileManager | ||
path | string | The path or a file or directory that manager is about to attempt to move, copy, rename, delete, or link to. |
Return:
void |
public fileTransferServicesAbortCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesConnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesCopyRemoteFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesCopyRemoteFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void source
Return:
void |
public fileTransferServicesCreateFolderCompleteErrorFolder(inServices: OBEXFileTransferServices, inError: OBEXError, inFolderName: string): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError | ||
inFolderName | string |
|
Return:
void |
public fileTransferServicesDisconnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesFilePreparationCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesPathChangeCompleteErrorFinalPath(inServices: OBEXFileTransferServices, inError: OBEXError, inPath: string): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError | ||
inPath | string |
|
Return:
void |
public fileTransferServicesRemoveItemCompleteErrorRemovedItem(inServices: OBEXFileTransferServices, inError: OBEXError, inItemName: string): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError | ||
inItemName | string |
|
Return:
void |
public fileTransferServicesRetrieveFolderListingCompleteErrorListing(inServices: OBEXFileTransferServices, inError: OBEXError, inListing: Object[]): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError | ||
inListing | Object[] |
|
Return:
void |
public fileTransferServicesSendFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void source
Params:
Name | Type | Attribute | Description |
inServices | OBEXFileTransferServices |
|
|
inError | OBEXError |
Return:
void |
public fileTransferServicesSendFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void source
Return:
void |
public finalize(): void source
The garbage collector invokes this method on the receiver before disposing of the memory it uses. When garbage collection is enabled, this method is invoked instead of dealloc.You can override this method to relinquish resources the receiver has obtained, as shown in the following example:- (void)finalize { if (log_file != NULL) { fclose(log_file); log_file = NULL; } [super finalize]; } Typically, however, you are encouraged to relinquish resources prior to finalization if at all possible. For more details, see Implementing a finalize Method.Special ConsiderationsIt is an error to store self into a new or existing live object (colloquially known as “resurrection”), which implies that this method will be called only once. However, the receiver may be messaged after finalization by other objects also being finalized at this time, so your override should guard against future use of resources that have been reclaimed, as shown by the log_file = NULL statement in the example. The finalize method itself will never be invoked more than once for a given object.Importantfinalize methods must be thread-safe.- (void)finalize { if (log_file != NULL) { fclose(log_file); log_file = NULL; } [super finalize]; }
Return:
void |
public finalizeForWebScript(): void source
This method is invoked on objects exposed to the scripting environment just before the scripting environment is reset. After invocation, the receiving object will no longer be referenced by the scripting environment. Further references to WebScriptObject instances created by the exposed object will be invalid and may produce unpredictable results.
Return:
void |
public fontManagerWillIncludeFont(sender: Object, fontName: string): boolean source
In macOS versions 10.2 and earlier, this method is invoked repeatedly as necessary whenever the Font panel needs updating, such as when the Font panel is first loaded, and when the user selects a family name to see which typefaces in that family are available. Your implementation should execute fairly quickly to ensure the responsiveness of the Font panel.Important
This delegate method is not called in macOS versions 10.3 and later.
public forwardingTargetFor(aSelector: function): Object source
If an object implements (or inherits) this method, and returns a non-nil (and non-self) result, that returned object is used as the new receiver object and the message dispatch resumes to that new object. (Obviously if you return self from this method, the code would just fall into an infinite loop.)If you implement this method in a non-root class, if your class has nothing to return for the given selector then you should return the result of invoking super’s implementation. This method gives an object a chance to redirect an unknown message sent to it before the much more expensive forwardInvocation: machinery takes over. This is useful when you simply want to redirect messages to another object and can be an order of magnitude faster than regular forwarding. It is not useful where the goal of the forwarding is to capture the NSInvocation, or manipulate the arguments or return value during the forwarding.
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
A Selector for a method that the receiver does not implement. |
public handleClient(event: NSEvent, sender: Object): boolean source
Handles key down and mouse events.
Params:
Name | Type | Attribute | Description |
event | NSEvent |
|
The event to handle. |
sender | Object |
|
The client object sending the event. |
public imageBrowserBackgroundWasRightClickedWith(aBrowser: IKImageBrowserView, event: NSEvent): void source
This method signals that the user either right-clicked the background or left-clicked it with the Alt key pressed. You can implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
event | NSEvent |
|
The event that invoked the method. |
Return:
void |
public imageBrowserCellWasDoubleClickedAt(aBrowser: IKImageBrowserView, index: number): void source
This method signals that the user double-clicked an item in the image browser view. You can implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
index | number | The index of the cell. |
Return:
void |
public imageBrowserCellWasRightClickedAtWith(aBrowser: IKImageBrowserView, index: number, event: NSEvent): void source
This method signals that the user either right-clicked an item in the browser or left-clicked the item with the Alt key pressed. You can implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
index | number | The index of the cell. |
|
event | NSEvent |
|
The event that invoked the method. |
Return:
void |
public imageBrowserGroupAt(aBrowser: IKImageBrowserView, index: number): Map<AnyHashable, Object> source
This method is optional.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
index | number | The index of the group you want to retrieve. |
public imageBrowserItemAt(aBrowser: IKImageBrowserView, index: number): Object source
Your data source must implement this method. The returned object must implement the required methods of the IKImageBrowserItem protocol.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
index | number | The index of the item you want to retrieve. |
public imageBrowserMoveItemsAtTo(aBrowser: IKImageBrowserView, indexes: Set, destinationIndex: number): boolean source
This method is optional. It is invoked by the image browser view after Image Kit determines that a reordering operation should be applied. The data source should update itself by reordering its elements.
public imageBrowserRemoveItemsAt(aBrowser: IKImageBrowserView, indexes: Set): void source
This method is optional. It is invoked by the image browser after Image Kit determines that a remove operation should be applied. In response, the data source should update itself by removing the specified items.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
indexes | Set |
|
The indexes of the items that should be removed. |
Return:
void |
public imageBrowserSelectionDidChange(aBrowser: IKImageBrowserView): void source
This method signals that the user changes the selection in the image browser view. You can implement this method if you want to perform custom tasks at that time.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
Return:
void |
public imageBrowserWriteItemsAtTo(aBrowser: IKImageBrowserView, itemIndexes: Set, pasteboard: NSPasteboard): number source
This method is optional. It is invoked after Image Kit determines that a drag should begin, but before the drag has been started.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
itemIndexes | Set |
|
The indexes of the items that should be dragged. |
pasteboard | NSPasteboard |
|
The pasteboard to copy the items to. |
public imageRepresentation(): Object source
Your data source must implement this method. This method is called frequently, so the receiver should cache the returned instance.
public imageUID(): string source
Your data source must implement this method. The image browser view uses this identifier to associate the data source item and its cache.
public imageVersion(): number source
This method is optional. The receiver can return a new version to let the image browser know that it should not use its cache for the item.
public indexOfAccessibilityElement(element: Object): number source
Returns the index of the specified accessibility element.
Params:
Name | Type | Attribute | Description |
element | Object | The accessibility element. |
public indicesOfObjectsByEvaluatingObjectSpecifier(specifier: NSScriptObjectSpecifier): number[] source
Containers that want to evaluate some specifiers on their own should implement this method. If this method returns nil, the object specifier will go on to do its own evaluation, so you should only return nil if that's the behavior you want, or if an error occurs. If this method returns an array, the object specifier will use the NSNumber objects in it as the indices. So, if you evaluate the specifier and there are no objects that match, you should return an empty array, not nil. If you find only one object, you should still return its index in an array. Returning an array with a single index where the index is – is interpreted to mean all the objects.For an example implementation, see "Implementing Object Specifiers" in Object Specifiers in Cocoa Scripting Guide
Params:
Name | Type | Attribute | Description |
specifier | NSScriptObjectSpecifier | An object specifier for the container objects for which to obtain the indices. |
public infoForBinding(binding: string): Map<string, Object> source
This method is mostly for use by subclasses which want to analyze the existing bindings of an object.
Params:
Name | Type | Attribute | Description |
binding | string | The name of a binding. |
public inputTextClient(string: string, sender: Object): boolean source
An input method should implement this method when using key binding (that is, it implements didCommand(by:client:)).
public inputTextKeyModifiersClient(string: string, keyCode: number, flags: number, sender: Object): boolean source
Receives Unicode, the key code that generated it, and any modifier flags.
public insertValueAtInPropertyWithKey(value: Object, index: number, key: string): void source
The method insertIn<Key>:atIndex: is invoked if it exists. If no corresponding scripting-KVC-compliant method (insertIn<Key>:atIndex: ) is found, this method invokes mutableArrayValueForKey: and mutates the result.Note Prior to OS X version 10.4, this method did not invoke -mutableArrayValueForKey:.
Return:
void |
public insertValueInPropertyWithKey(value: Object, key: string): void source
The method insertIn<Key>: is used if it exists. Otherwise, raises an NSUndefinedKeyException. This is part of Cocoa’s scripting support for inserting newly-created objects into containers without explicitly specifying a location.
Return:
void |
public inverseForRelationshipKey(relationshipKey: string): string source
NSObject’s implementation of inverseForRelationshipKey: simply invokes [[self classDescription] inverseForRelationshipKey:relationshipKey]. To make use of the default implementation, you must therefore implement and register a suitable class description—see NSClassDescription.For example, suppose an Employee class has a relationship named department to a Department class, and that Department has a relationship called employees to Employee. The statement:employee inverseForRelationshipKey:@"department"]; returns the string employees.employee inverseForRelationshipKey:@"department"];
Params:
Name | Type | Attribute | Description |
relationshipKey | string | The name of the relationship from the receiver’s class to another class. |
public invokeDefaultMethodWithArguments(_arguments: Object[]): Object source
Executes when a script attempts to invoke a method on an exposed object directly.
Params:
Name | Type | Attribute | Description |
_arguments | Object[] |
|
public invokeUndefinedMethodFromWebScriptWithArguments(name: string, _arguments: Object[]): Object source
This method is invoked when a script attempts to invoke a method not directly exported to the scripting environment. You should return the result of the invocation, converted appropriately for the scripting environment.
public isCaseInsensitiveLike(object: string): boolean source
Currently, isCaseInsensitiveLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject returns false. NSString also provides an implementation of this method, which returns true if the receiver matches a pattern described by aString, ignoring the case of the characters in the receiver.
Params:
Name | Type | Attribute | Description |
object | string |
public isEqualTo(object: Object): boolean source
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSEqualToComparison, an isEqual(to:) message may be sent to each potentially specified object, if neither the potentially specified object nor the object being tested against implements a scriptingIsEqual(to:) method.The default implementation for this method provided by NSObject returns true if an isEqualTo: message sent to the same object would return true.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public isGreaterThan(object: Object): boolean source
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanComparison, an isGreaterThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThan(:) method and the object being tested against does not implement a scriptingIsLessThanOrEqual(to:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedDescending.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public isGreaterThanOrEqualTo(object: Object): boolean source
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanOrEqualToComparison, anisGreaterThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsLessThan(_:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedSame or NSOrderedDescending.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public isInstanceOf(aClass: Object): boolean source
Params:
Name | Type | Attribute | Description |
aClass | Object | A class object. |
public isLessThan(object: Object): boolean source
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanComparison, an isLessThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThan(:) method and the object being tested against does not implement a scriptingIsGreaterThanOrEqual(to:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public isLessThanOrEqualTo(object: Object): boolean source
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanOrEqualToComparison, an isLessThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsGreaterThan(_:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending or NSOrderedSame.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public isLike(object: string): boolean source
Currently, isLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns false. NSString also provides an implementation of this method, which returns true if the receiver matches a pattern described by object.
Params:
Name | Type | Attribute | Description |
object | string | The object with which to compare the receiver. |
public isNotEqualTo(object: Object): boolean source
Currently, isNotEqual(to:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns true if an isEqual: message sent to the same object would return false.
Params:
Name | Type | Attribute | Description |
object | Object |
|
The object with which to compare the receiver. |
public layerShouldInheritContentsScaleFrom(layer: CALayer, newScale: number, window: NSWindow): boolean source
When a resolution change occurs for a given window, the system traverses the layer trees in that window to decide what action, if any, to take for each layer. The system queries the layer’s delegate to determine whether to change the layer’s contentsScale property to the new scale (either 2.0 or 1.0). Note that you don’t need to manage NSImage contents and that this method is not called on the delegate of a layer whose content is an NSImage object.If the delegate returns true, it should make any corresponding changes to the layer’s properties, as required by the resolution change. For example, a layer whose contents contain a CGImage object needs to determine whether an alternate CGImage object is available for the new scale factor. If the delegate finds a suitable CGImage object, then in addition to returning true, it should set the appropriate CGImage object as the layer’s new contents.
Params:
Name | Type | Attribute | Description |
layer | CALayer | The layer whose scale and content might need updating. |
|
newScale | number | The new scale of the window. |
|
window | NSWindow | The window that hosts the layer. |
public methodFor(aSelector: function): function source
If the receiver is an instance, aSelector should refer to an instance method; if the receiver is a class, it should refer to a class method.
Params:
Name | Type | Attribute | Description |
aSelector | function |
|
A Selector that identifies the method for which to return the implementation address. The selector must be a valid and non-NULL. If in doubt, use the responds(to:) method to check before passing the selector to method(for:). |
public mutableArrayValueForKey(key: string): Array source
Objects added to the mutable array become related to the receiver, and objects removed from the mutable array become unrelated. The default implementation recognizes the same simple accessor methods and array accessor methods as value(forKey:), and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that value(forKey:) would return. The search pattern that mutableArrayValueForKey: uses is described in Accessor Search Patterns in Key-Value Coding Programming Guide.
Params:
Name | Type | Attribute | Description |
key | string | The name of an ordered to-many relationship. |
public mutableArrayValueForKeyPath(keyPath: string): Array source
See mutableArrayValue(forKey:) for additional details.
Params:
Name | Type | Attribute | Description |
keyPath | string | A key path, relative to the receiver, to an ordered to-many relationship. |
public mutableCopy(): Object source
This is a convenience method for classes that adopt the NSMutableCopying protocol. An exception is raised if there is no implementation for mutableCopy(with:).
public mutableOrderedSetValueForKey(key: string): Set source
Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. The default implementation recognizes the same simple accessor methods and set accessor methods as value(forKey:), and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that value(forKey:) would return. The search pattern that mutableOrderedSetValueForKey: uses is described in Accessor Search Patterns in Key-Value Coding Programming Guide.
Params:
Name | Type | Attribute | Description |
key | string | The name of a uniquing ordered to-many relationship. |
public mutableOrderedSetValueForKeyPath(keyPath: string): Set source
See mutableOrderedSetValue(forKey:) for additional details.
Params:
Name | Type | Attribute | Description |
keyPath | string | A key path, relative to the receiver, to a uniquing ordered to-many relationship represented by a set. |
public mutableSetValueForKey(key: string): Set source
Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. The default implementation recognizes the same simple accessor methods and set accessor methods as value(forKey:), and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that value(forKey:) would return. The search pattern that mutableSetValueForKey: uses is described in Accessor Search Patterns in Key-Value Coding Programming Guide.
Params:
Name | Type | Attribute | Description |
key | string | The name of an unordered to-many relationship. |
public mutableSetValueForKeyPath(keyPath: string): Set source
See mutableSetValue(forKey:) for additional details.
Params:
Name | Type | Attribute | Description |
keyPath | string | A key path, relative to the receiver, to an unordered to-many relationship. |
public namesOfPromisedFilesDroppedAtDestination(dropDestination: string): string[] source
This method is invoked when the drop has been accepted by the destination and the destination, in the case of another Cocoa application, invokes the NSDraggingInfo method namesOfPromisedFilesDropped(atDestination:). For long operations, you can cache dropDestination and defer the creation of the files until the draggedImage:endedAt:operation: method to avoid blocking the destination application.
Params:
Name | Type | Attribute | Description |
dropDestination | string | A URL object that identifies the location at which the promised files will be created. |
public newScriptingObjectOfForValueForKeyWithContentsValue(objectClass: Object, key: string, contentsValue: Object, properties: Map<string, Object>): Object source
You can override the newScriptingObjectOfClass method to take more control when your application is sent a make command. This method is invoked on the prospective container of the new object. The contentsValue and properties are derived from the with contents and with properties parameters of the make command. The returned objects or objects are then inserted into the container using key-value coding.When this method is invoked by Cocoa, neither the contents value nor the properties will have yet been coerced using the NSScriptKeyValueCoding method coerceValue(_:forKey:). For sdef-declared scriptability, however, the types of the passed-in objects reliably match the relevant sdef declarations.The default implementation of this method creates new scripting objects by sending alloc to a class and init to the resulting object. You override this method for situations where this is not sufficient, such as in Core Data applications, in which new objects must be initialized with [NSManagedObject initWithEntity:insertIntoManagedObjectContext:].
Params:
Name | Type | Attribute | Description |
objectClass | Object | ||
key | string | A key that identifies the relationship into which the new class object will be inserted. |
|
contentsValue | Object |
|
Specifies the contents of the object to be created. This may be nil. (See also the Discussion section.) |
properties | Map<string, Object> | The properties to be set in the new object. (See also the Discussion section.) |
public numberOfGroupsInImageBrowser(aBrowser: IKImageBrowserView): number source
This method is optional.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
public numberOfItemsInImageBrowser(aBrowser: IKImageBrowserView): number source
Your data source must implement this method. An IKImageView object uses this method to determine how many cells it should create and display.
Params:
Name | Type | Attribute | Description |
aBrowser | IKImageBrowserView |
|
An image browser view. |
public objectDidBeginEditing(editor: Object): void source
This message should be sent to the receiver when editor has uncommitted changes that can affect the receiver.
Params:
Name | Type | Attribute | Description |
editor | Object |
Return:
void |
public objectDidEndEditing(editor: Object): void source
This message should be sent to the receiver when editor has finished editing a property belonging to the receiver.
Params:
Name | Type | Attribute | Description |
editor | Object |
Return:
void |
public observeValueForKeyPathOf(keyPath: string, object: Object, change: Map<NSKeyValueChangeKey, Object>, context: Object): void source
For an object to begin sending change notification messages for the value at keyPath, you send it an addObserver(:forKeyPath:options:context:) message, naming the observing object that should receive the messages. When you are done observing, and in particular before the observing object is deallocated, you send the observed object a removeObserver(:forKeyPath:) or removeObserver(_:forKeyPath:context:) message to unregister the observer, and stop sending change notification messages.
Params:
Name | Type | Attribute | Description |
keyPath | string |
|
The key path, relative to object, to the value that has changed. |
object | Object |
|
The source object of the key path keyPath. |
change | Map<NSKeyValueChangeKey, Object> |
|
A dictionary that describes the changes that have been made to the value of the property at the key path keyPath relative to object. Entries are described in Change Dictionary Keys. |
context | Object |
|
The value that was provided when the observer was registered to receive key-value observation notifications. |
Return:
void |
public optionDescriptionsForBinding(binding: string): NSAttributeDescription[] source
The NSAttributeDescription instances in the array are used by Interface Builder to build the options editor user interface of the bindings inspector.The option name displayed for the option in the bindings inspector is based on the value of the NSAttributeDescription method name. The type of editor displayed for the option in the bindings inspector is based on the value of the NSAttributeDescription method attributeType.The default value displayed in the bindings inspector for the option is based on the value of the NSAttributeDescription method defaultValue.
Params:
Name | Type | Attribute | Description |
binding | string | The name of a binding |
Return:
NSAttributeDescription[] |
public originalString(sender: Object): string source
Return the a string that consists of the precomposed unicode characters.
Params:
Name | Type | Attribute | Description |
sender | Object |
|
The client object requesting the original string. |
public pasteboardChangedOwner(sender: NSPasteboard): void source
Pasteboard owners only need to implement this method if they need to know when they have lost ownership.The owner is not able to read the contents of the pasteboard when responding to this method. The owner should be prepared to receive this method at any time, even from within the declareTypes(_:owner:) method used to declare ownership.Once an owner has provided all of its data for declared types, it will not receive a pasteboardChangedOwner: message. If, therefore, you are maintaining an object just for the purpose of providing data lazily, rather than relying solely on receipt of a pasteboardChangedOwner: message you need to keep track of what types were promised and what types have been provided. When all the types have been provided, you may release the owner.
Params:
Name | Type | Attribute | Description |
sender | NSPasteboard | The pasteboard object whose owner changed. |
Return:
void |
public pasteboardProvideDataForType(sender: NSPasteboard, type: string): void source
The receiver should have been previously declared in a declareTypes(:owner:) message.The requested data should be written to sender using the setData(:forType:), setPropertyList(:forType:), or setString(:forType:) method. The pasteboard(:provideDataForType:) messages may also be sent to the owner when the application is shut down through an application’s terminate(:) method. This is the method that is invoked in response to a Quit command. Thus the user can copy something to the pasteboard, quit the application, and still paste the data that was copied. A pasteboard(:provideDataForType:) message is sent only if the specified type of data has not already been supplied to the pasteboard. Instead of writing all data types when the cut or copy operation is done, an application can choose to implement this method to provide the data for certain types only when they are requested.If an application writes data to the pasteboard in the richest, and therefore most preferred, type at the time of a cut or copy operation, its pasteboard(:provideDataForType:) method can simply read that data from the pasteboard, convert it to the requested type, and write it back to the pasteboard as the new type.
Params:
Name | Type | Attribute | Description |
sender | NSPasteboard | The pasteboard that requires the specified data for a paste operation. |
|
type | string | The type of data the owner object must provide. |
Return:
void |
public performActionFor(person: ABPerson, identifier: string): void source
If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. The person being displayed in the Address Book application’s card view when the rollover menu is accesses is passed as person.
Params:
Name | Type | Attribute | Description |
person | ABPerson |
|
The person on which the action will be taken. |
identifier | string |
|
The unique identifier of the selected value. |
Return:
void |
public performOnWithWaitUntilDone(aSelector: function, thr: Thread, arg: Object, wait: boolean): void source
You can use this method to deliver messages to other threads in your application. The message in this case is a method of the current object that you want to execute on the target thread. This method queues the message on the run loop of the target thread using the default run loop modes—that is, the modes associated with the commonModes constant. As part of its normal run loop processing, the target thread dequeues the message (assuming it is running in one of the default run loop modes) and invokes the desired method.You cannot cancel messages queued using this method. If you want the option of canceling a message on the current thread, you must use either the perform(:with:afterDelay:) or perform(:with:afterDelay:inModes:) method.Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
thr | Thread | ||
arg | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
wait | boolean | A Boolean that specifies whether the current thread blocks until after the specified selector is performed on the receiver on the specified thread. Specify true to block this thread; otherwise, specify false to have this method return immediately.If the current thread and target thread are the same, and you specify true for this parameter, the selector is performed immediately on the current thread. If you specify false, this method queues the message on the thread’s run loop and returns, just like it does for other threads. The current thread must then dequeue and process the message when it has an opportunity to do so. |
Return:
void |
public performOnWithWaitUntilDoneModes(aSelector: function, thr: Thread, arg: Object, wait: boolean, array: string[]): void source
You can use this method to deliver messages to other threads in your application. The message in this case is a method of the current object that you want to execute on the target thread. This method queues the message on the run loop of the target thread using the run loop modes specified in the array parameter. As part of its normal run loop processing, the target thread dequeues the message (assuming it is running in one of the specified modes) and invokes the desired method. You cannot cancel messages queued using this method. If you want the option of canceling a message on the current thread, you must use either the perform(:with:afterDelay:) or perform(:with:afterDelay:inModes:) method instead. Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. It should not have a significant return value and should take a single argument of type id, or no arguments. |
|
thr | Thread | ||
arg | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
wait | boolean | A Boolean that specifies whether the current thread blocks until after the specified selector is performed on the receiver on the specified thread. Specify true to block this thread; otherwise, specify false to have this method return immediately. If the current thread and target thread are the same, and you specify true for this parameter, the selector is performed immediately. If you specify false, this method queues the message and returns immediately, regardless of whether the threads are the same or different. |
|
array | string[] |
|
An array of strings that identifies the modes in which it is permissible to perform the specified selector. This array must contain at least one string. If you specify nil or an empty array for this parameter, this method returns without performing the specified selector. For information about run loop modes, see Run Loops in Threading Programming Guide. |
Return:
void |
public performSelectorInBackgroundWith(aSelector: function, arg: Object): void source
This method creates a new thread in your application, putting your application into multithreaded mode if it was not already. The method represented by aSelector must set up the thread environment just as you would for any other new thread in your program. For more information about how to configure and run threads, see Threading Programming Guide.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
arg | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
Return:
void |
public performSelectorOnMainThreadWithWaitUntilDone(aSelector: function, arg: Object, wait: boolean): void source
You can use this method to deliver messages to the main thread of your application. The main thread encompasses the application’s main run loop, and is where the NSApplication object receives events. The message in this case is a method of the current object that you want to execute on the thread. This method queues the message on the run loop of the main thread using the common run loop modes—that is, the modes associated with the commonModes constant. As part of its normal run loop processing, the main thread dequeues the message (assuming it is running in one of the common run loop modes) and invokes the desired method. Multiple calls to this method from the same thread cause the corresponding selectors to be queued and performed in the same same order in which the calls were made.You cannot cancel messages queued using this method. If you want the option of canceling a message on the current thread, you must use either the perform(:with:afterDelay:) or perform(:with:afterDelay:inModes:) method.Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
arg | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
wait | boolean | A Boolean that specifies whether the current thread blocks until after the specified selector is performed on the receiver on the main thread. Specify true to block this thread; otherwise, specify false to have this method return immediately.If the current thread is also the main thread, and you specify true for this parameter, the message is delivered and processed immediately. |
Return:
void |
public performSelectorOnMainThreadWithWaitUntilDoneModes(aSelector: function, arg: Object, wait: boolean, array: string[]): void source
You can use this method to deliver messages to the main thread of your application. The main thread encompasses the application’s mai run loop, and is where the NSApplication object receives events. The message in this case is a method of the current object that you want to execute on the thread. This method queues the message on the run loop of the main thread using the run loop modes specified in the array parameter. As part of its normal run loop processing, the main thread dequeues the message (assuming it is running in one of the specified modes) and invokes the desired method. Multiple calls to this method from the same thread cause the corresponding selectors to be queued and performed in the same same order in which the calls were made, assuming the associated run loop modes for each selector are the same. If you specify different modes for each selector, any selectors whose associated mode does not match the current run loop mode are skipped until the run loop subsequently executes in that mode.You cannot cancel messages queued using this method. If you want the option of canceling a message on the current thread, you must use either the perform(:with:afterDelay:) or perform(:with:afterDelay:inModes:) method.Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
arg | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
wait | boolean | A Boolean that specifies whether the current thread blocks until after the specified selector is performed on the receiver on the main thread. Specify true to block this thread; otherwise, specify false to have this method return immediately.If the current thread is also the main thread, and you pass true, the message is performed immediately, otherwise the perform is queued to run the next time through the run loop. |
|
array | string[] |
|
An array of strings that identifies the modes in which it is permissible to perform the specified selector. This array must contain at least one string. If you specify nil or an empty array for this parameter, this method returns without performing the specified selector. For information about run loop modes, see Run Loops in Threading Programming Guide. |
Return:
void |
public performWithAfterDelay(aSelector: function, anArgument: Object, delay: number): void source
This method sets up a timer to perform the aSelector message on the current thread’s run loop. The timer is configured to run in the default mode (NSDefaultRunLoopMode). When the timer fires, the thread attempts to dequeue the message from the run loop and perform the selector. It succeeds if the run loop is running and in the default mode; otherwise, the timer waits until the run loop is in the default mode. If you want the message to be dequeued when the run loop is in a mode other than the default mode, use the perform(_:with:afterDelay:inModes:) method instead. If you are not sure whether the current thread is the main thread, you can use the performSelector(onMainThread:with:waitUntilDone:) or performSelector(onMainThread:with:waitUntilDone:modes:) method to guarantee that your selector executes on the main thread. To cancel a queued message, use the cancelPreviousPerformRequests(withTarget:) or cancelPreviousPerformRequests(withTarget:selector:object:) method. Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
anArgument | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
delay | number | The minimum time before which the message is sent. Specifying a delay of 0 does not necessarily cause the selector to be performed immediately. The selector is still queued on the thread’s run loop and performed as soon as possible. |
Return:
void |
public performWithAfterDelayInModes(aSelector: function, anArgument: Object, delay: number, modes: RunLoopMode[]): void source
This method sets up a timer to perform the aSelector message on the current thread’s run loop. The timer is configured to run in the modes specified by the modes parameter. When the timer fires, the thread attempts to dequeue the message from the run loop and perform the selector. It succeeds if the run loop is running and in one of the specified modes; otherwise, the timer waits until the run loop is in one of those modes. If you want the message to be dequeued when the run loop is in a mode other than the default mode, use the perform(_:with:afterDelay:inModes:) method instead. If you are not sure whether the current thread is the main thread, you can use the performSelector(onMainThread:with:waitUntilDone:) or performSelector(onMainThread:with:waitUntilDone:modes:) method to guarantee that your selector executes on the main thread. To cancel a queued message, use the cancelPreviousPerformRequests(withTarget:) or cancelPreviousPerformRequests(withTarget:selector:object:) method. Special ConsiderationsThis method registers with the runloop of its current context, and depends on that runloop being run on a regular basis to perform correctly. One common context where you might call this method and end up registering with a runloop that is not automatically run on a regular basis is when being invoked by a dispatch queue. If you need this type of functionality when running on a dispatch queue, you should use dispatchafter(:::) and related methods to get the behavior you want.
Params:
Name | Type | Attribute | Description |
aSelector | function | A Selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments. |
|
anArgument | Object |
|
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument. |
delay | number | The minimum time before which the message is sent. Specifying a delay of 0 does not necessarily cause the selector to be performed immediately. The selector is still queued on the thread’s run loop and performed as soon as possible. |
|
modes | RunLoopMode[] | An array of strings that identify the modes to associate with the timer that performs the selector. This array must contain at least one string. If you specify nil or an empty array for this parameter, this method returns without performing the specified selector. For information about run loop modes, see Run Loops in Threading Programming Guide. |
Return:
void |
public prepareForInterfaceBuilder(): void source
When Interface Builder instantiates a class with the IB_DESIGNABLE attribute, it calls this method to let the resulting object know that it was created at design time. You can implement this method in your designable classes and use it to configure their design-time appearance. For example, you might use the method to configure a custom text control with a default string. The system does not call this method; only Interface Builder calls it.Interface Builder waits until all objects in a graph have been created and initialized before calling this method. So if your object’s runtime configuration relies on subviews or parent views, those objects should exist by the time this method is called.Your implementation of this method must call super at some point so that parent classes can perform their own custom setup.
Return:
void |
public provideImageDataBytesPerRowOriginSizeUserInfo(data: Object, rowbytes: number, x: number, y: number, width: number, height: number, info: Object): void source
You can supply the image provider to these methods of the CIImage class: imageWithImageProvider:size::format:colorSpace:options: to create a CIImage object from image datainit(imageProvider:size:_:format:colorSpace:options:) to initialize an existing CIImage with dataYou initialize the given bitmap with the subregion specified by the arguments x, y, width, and height. The subregion uses the local coordinate space of the image, with the origin at the upper-left corner of the image. If you change the virtual memory mapping of the buffer specified by the data argument (such as by using vm_copy to modify it), the behavior is undefined.That this callback always requests the full image data regardless of what is actually visible. All of the image is loaded or none of it is. The exception is when you create a tiled image by specifying the kCIImageProviderTileSize option. In this case, only the needed tiles are requested.
Params:
Name | Type | Attribute | Description |
data | Object | A pointer to image data. Note that data[0] refers to the first byte of the requested subimage, not the larger image buffer. |
|
rowbytes | number | The number of bytes per row. |
|
x | number | The x origin of the image data. |
|
y | number | The y origin of the image data. |
|
width | number | The width of the image data. |
|
height | number | The height of the image data. |
|
info | Object |
|
User supplied data, which is optional. |
Return:
void |
public quartzFilterManagerDidAdd(sender: QuartzFilterManager, filter: QuartzFilter): void source
Params:
Name | Type | Attribute | Description |
sender | QuartzFilterManager |
|
|
filter | QuartzFilter |
|
Return:
void |
public quartzFilterManagerDidModifyFilter(sender: QuartzFilterManager, filter: QuartzFilter): void source
Params:
Name | Type | Attribute | Description |
sender | QuartzFilterManager |
|
|
filter | QuartzFilter |
|
Return:
void |
public quartzFilterManagerDidRemove(sender: QuartzFilterManager, filter: QuartzFilter): void source
Params:
Name | Type | Attribute | Description |
sender | QuartzFilterManager |
|
|
filter | QuartzFilter |
|
Return:
void |
public quartzFilterManagerDidSelect(sender: QuartzFilterManager, filter: QuartzFilter): void source
Params:
Name | Type | Attribute | Description |
sender | QuartzFilterManager |
|
|
filter | QuartzFilter |
|
Return:
void |
public readLinkQualityForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCILinkQualityInfo>, error: IOReturn): void source
This delegate gets invoked when an read link quality command complete event occurs. This could occur because you invoked it by issuing an -readLinkQualityForDevice: command, or someone else did from another app on the same controller.
Params:
Name | Type | Attribute | Description |
controller | Object |
|
|
device | IOBluetoothDevice |
|
|
info | UnsafeMutablePointer<BluetoothHCILinkQualityInfo> |
|
|
error | IOReturn |
Return:
void |
public readRSSIForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCIRSSIInfo>, error: IOReturn): void source
This delegate gets invoked when an RSSI command complete event occurs. This could occur because you invoked it by issuing an -readRSSIForDevice: command, or someone else did from another app on the same controller.
Params:
Name | Type | Attribute | Description |
controller | Object |
|
|
device | IOBluetoothDevice |
|
|
info | UnsafeMutablePointer<BluetoothHCIRSSIInfo> |
|
|
error | IOReturn |
Return:
void |
public removeObserverForKeyPath(observer: NSObject, keyPath: string): void source
It is an error to call removeObserver(:forKeyPath:) for an object that has not previously been registered as an observer.Be sure to invoke this method (or removeObserver(:forKeyPath:context:)) before any object specified in addObserver(_:forKeyPath:options:context:) is deallocated.
Return:
void |
public removeValueAtFromPropertyWithKey(index: number, key: string): void source
The method removeFrom<Key>AtIndex: is invoked if it exists. If no corresponding scripting-KVC-compliant method (-removeFrom<Key>AtIndex:) is found, this method invokes -mutableArrayValueForKey: and mutates the result.Note Prior to OS X version 10.4, this method did not invoke -mutableArrayValueForKey:.
Return:
void |
public replaceValueAtInPropertyWithKeyWithValue(index: number, key: string, value: Object): void source
The method replaceIn<Key>:atIndex: is invoked if it exists. If no corresponding scripting-KVC-compliant method (-replaceIn<Key>atIndex:) is found, this method invokes -mutableArrayValueForKey: and mutates the result.Note Prior to OS X version 10.4, this method did not invoke -mutableArrayValueForKey:.
Return:
void |
public replacementObjectFor(aCoder: NSCoder): Object source
An object might encode itself into an archive, but encode a proxy for itself if it’s being encoded for distribution. This method is invoked by NSCoder. NSObject’s implementation returns self.
Params:
Name | Type | Attribute | Description |
aCoder | NSCoder | The coder encoding the receiver. |
public saveOptionsShouldShowUTType(saveOptions: IKSaveOptions, utType: string): boolean source
Called to determine if the specified uniform type identifier should be shown in the save panel.
Params:
Name | Type | Attribute | Description |
saveOptions | IKSaveOptions |
|
The IKSaveOptions instance that called the delegate. |
utType | string |
|
The uniform type identifier to test. |
public scriptingBeginsWith(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object matches the beginning of object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingContains(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object contains object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingEndsWith(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object matches the end of object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingIsEqualTo(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object is equal to object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingIsGreaterThan(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object is greater than object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingIsGreaterThanOrEqualTo(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object is greater than or equal to object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingIsLessThan(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object is less than object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingIsLessThanOrEqualTo(object: Object): boolean source
Returns true if, in a scripting comparison, the compared object is less than or equal to object. A default implementation is provided for NSString and NSAttributedString.
Params:
Name | Type | Attribute | Description |
object | Object |
public scriptingValueFor(objectSpecifier: NSScriptObjectSpecifier): Object source
You can override this method to customize the evaluation of object specifiers without requiring that the scripting container make up indexes for contained objects that don't naturally have indexes (as can be the case if you implement indicesOfObjects(byEvaluatingObjectSpecifier:) instead).Your override of this method doesn't need to also invoke any of the NSScriptCommand error signaling methods, though it can, to record very specific information. The NSUnknownKeySpecifierError and NSInvalidIndexSpecifierError numbers are special, in that Cocoa may continue evaluating an outer specifier if they're encountered, for the convenience of scripters.
Params:
Name | Type | Attribute | Description |
objectSpecifier | NSScriptObjectSpecifier | An object specifier to be evaluated. |
public setNilValueForKey(key: string): void source
Subclasses can override this method to handle the request in some other way, such as by substituting 0 or a sentinel value for nil and invoking setValue(_:forKey:) again or setting the variable directly. The default implementation raises an NSInvalidArgumentException.
Params:
Name | Type | Attribute | Description |
key | string | The name of one of the receiver's properties. |
Return:
void |
public setValueForKey(value: Object, key: string): void source
If key identifies a to-one relationship, relate the object specified by value to the receiver, unrelating the previously related object if there was one. Given a collection object and a key that identifies a to-many relationship, relate the objects contained in the collection to the receiver, unrelating previously related objects if there were any. The search pattern that setValue:forKey: uses is described in Accessor Search Patterns in Key-Value Coding Programming Guide.In a reference-counted environment, if the instance variable is accessed directly, value is retained.
Return:
void |
public setValueForKeyPath(value: Object, keyPath: string): void source
The default implementation of this method gets the destination object for each relationship using value(forKey:), and sends the final object a setValue(_:forKey:) message.Special ConsiderationsWhen using this method, and the destination object does not implement an accessor for the value, the default behavior is for that object to retain value rather than copy or assign value.
Return:
void |
public setValueForUndefinedKey(value: Object, key: string): void source
Subclasses can override this method to handle the request in some other way. The default implementation raises an NSUndefinedKeyException.
Return:
void |
public setValuesForKeys(keyedValues: Map<string, Object>): void source
The default implementation invokes setValue(_:forKey:) for each key-value pair, substituting nil for NSNull values in keyedValues.
Return:
void |
public shouldEnableActionFor(person: ABPerson, identifier: string): boolean source
If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected.
Params:
Name | Type | Attribute | Description |
person | ABPerson |
|
The person on which the action will be taken. |
identifier | string |
|
The unique identifier of the selected value. |
public textStorageDidProcessEditing(notification: Notification): void source
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public textStorageWillProcessEditing(notification: Notification): void source
Params:
Name | Type | Attribute | Description |
notification | Notification |
Return:
void |
public titleFor(person: ABPerson, identifier: string): string source
If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected.
Params:
Name | Type | Attribute | Description |
person | ABPerson |
|
The person on which the action will be taken. |
identifier | string |
|
The unique identifier of the value for which the menu item will be displayed. |
public unbind(binding: string): void source
Removes a given binding between the receiver and a controller.
Params:
Name | Type | Attribute | Description |
binding | string | The name of a binding. |
Return:
void |
public validModesForFontPanel(fontPanel: NSFontPanel): number source
The mode masks are defined in Mode Masks. The Font Panel has the ability to hide elements that are not applicable for a given context by having the target respond to validModesForFontPanel(:). If the target desires a font panel mode other than the standard mode mask, it must respond to this method.This message is sent up the responder chain to the first responder implementing the method. Ideally that object should be the first responder found that also implements changeFont(:).
Params:
Name | Type | Attribute | Description |
fontPanel | NSFontPanel |
public validateMenuItem(menuItem: NSMenuItem): boolean source
The object implementing this method must be the target of menuItem. You can determine which menu item menuItem is by querying it for its tag or action. The following example disables the menu item associated with the nextRecord action method when the selected line in a table view is the last one; conversely, it disables the menu item with priorRecord as its action method when the selected row is the first one in the table view. (The countryKeys array contains names that appear in the table view.)- (BOOL)validateMenuItem:(NSMenuItem *)item { int row = [tableView selectedRow]; if ([item action] == @selector(nextRecord) && (row == [countryKeys indexOfObject:[countryKeys lastObject]])) { return NO; } if ([item action] == @selector(priorRecord) && row == 0) { return NO; } return YES; }
- (BOOL)validateMenuItem:(NSMenuItem *)item { int row = [tableView selectedRow]; if ([item action] == @selector(nextRecord) && (row == [countryKeys indexOfObject:[countryKeys lastObject]])) { return NO; } if ([item action] == @selector(priorRecord) && row == 0) { return NO; } return YES; }
Params:
Name | Type | Attribute | Description |
menuItem | NSMenuItem | An NSMenuItem object that represents the menu item. |
public validateToolbarItem(item: NSToolbarItem): boolean source
NSToolbar only calls this method for image items.Note validateToolbarItem(_:) is called very frequently, so it must be efficient.If the receiver is the target for the actions of multiple toolbar items, it’s necessary to determine which toolbar item theItem refers to by testing the itemIdentifier.-(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; } -(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; }
Params:
Name | Type | Attribute | Description |
item | NSToolbarItem |
public validateValueForKey(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKey: string): void source
The default implementation of this method searches the class of the receiver for a validation method whose name matches the pattern validate<Key>:error:. If such a method is found it is invoked and the result is returned. If no such method is found, true is returned.The sender of the message is never given responsibility for releasing ioValue or outError. See Adding Validation for more information.Handling Errors in Swift: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language (Swift 3.1) and Error Handling in Using Swift with Cocoa and Objective-C (Swift 3.1).
Params:
Name | Type | Attribute | Description |
ioValue | AutoreleasingUnsafeMutablePointer<AnyObject?> | A pointer to a new value for the property identified by key. This method may modify or replace the value in order to make it valid. |
|
inKey | string |
Return:
void |
Throw:
public validateValueForKeyPath(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKeyPath: string): void source
The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a validateValue(_:forKey:) message to the final object.Handling Errors in Swift: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language (Swift 3.1) and Error Handling in Using Swift with Cocoa and Objective-C (Swift 3.1).
Params:
Name | Type | Attribute | Description |
ioValue | AutoreleasingUnsafeMutablePointer<AnyObject?> | A pointer to a new value for the property identified by keyPath. This method may modify or replace the value in order to make it valid. |
|
inKeyPath | string |
Return:
void |
Throw:
public valueAtInPropertyWithKey(index: number, key: string): Object source
This actually works with a single-value key as well if index is 0. The method valueIn<Key>AtIndex: is used if it exists.
public valueClassForBinding(binding: string): Object source
This method is used by Interface Builder to determine the appropriate transformers for a binding. Implementation of this method is optional.
Params:
Name | Type | Attribute | Description |
binding | string | The name of a binding. |
public valueForKey(key: string): Object source
The search pattern that valueForKey: uses to find the correct value to return is described in Accessor Search Patterns in Key-Value Coding Programming Guide.
Params:
Name | Type | Attribute | Description |
key | string | The name of one of the receiver's properties. |
public valueForKeyPath(keyPath: string): Object source
The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a value(forKey:) message to the final object.
Params:
Name | Type | Attribute | Description |
keyPath | string | A key path of the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”. |
public valueForUndefinedKey(key: string): Object source
Subclasses can override this method to return an alternate value for undefined keys. The default implementation raises an NSUndefinedKeyException.
Params:
Name | Type | Attribute | Description |
key | string | A string that is not equal to the name of any of the receiver's properties. |
public valueWithNameInPropertyWithKey(name: string, key: string): Object source
The method valueIn<Key>WithName: is used if it exists. Otherwise, raises an NSUndefinedKeyException.
public valueWithUniqueIDInPropertyWithKey(uniqueID: Object, key: string): Object source
The method valueIn<Key>WithUniqueID: is invoked if it exists. Otherwise, raises an NSUndefinedKeyException. The declared type of uniqueID in the constructed method must be id, NSNumber , NSString , or one of the scalar types that can be encapsulated by NSNumber.
public viewStringForToolTipUserData(view: NSView, tag: NSToolTipTag, point: CGPoint, data: Object): string source
userData is additional information provided by the creator of the tool tip rectangle.
public webPlugInContainerLoadInFrame(request: URLRequest, target: string): void source
If the frame specified by target is not found, a new window is opened, loaded with the URL request, and given the specified frame name. If target is nil, the frame enclosing the plug-in is loaded with the URL request.
Params:
Name | Type | Attribute | Description |
request | URLRequest |
|
The request that specifies the URL. |
target | string |
|
The frame into which the URL is loaded. |
Return:
void |
public webPlugInContainerShowStatus(message: string): void source
Tells the container to show a status message.
Params:
Name | Type | Attribute | Description |
message | string |
|
The status message to be displayed. |
Return:
void |
public webPlugInDestroy(): void source
Typically, this method frees the memory and other resources used by the plug-in. For example, if the plug-in had a copy of a WebPlugInContainer object, this method should relinquish ownership of that object. Do not send any other messages to the plug-in after invoking this method, because calling this method destroys the plug-in. No other methods in this interface may be called after the application has called this method.
Return:
void |
public webPlugInInitialize(): void source
Tells the plug-in to perform one-time initialization. This method must be called only once per instance of the plug-in object, before any other methods in the protocol are called.
Return:
void |
public webPlugInMainResourceDidFailWithError(error: Error): void source
This message is invoked when the underlying NSURLConnection object for the main resource sends the connection:didFailWithError: message to its delegate.
Params:
Name | Type | Attribute | Description |
error | Error |
|
An error object containing details of why the connection failed to load the request successfully. |
Return:
void |
public webPlugInMainResourceDidFinishLoading(): void source
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connectionDidFinishLoading: message to its delegate.
Return:
void |
public webPlugInMainResourceDidReceive(response: URLResponse): void source
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate.
Params:
Name | Type | Attribute | Description |
response | URLResponse |
|
The URL response for the connection's request. |
Return:
void |
public webPlugInSetIsSelected(isSelected: boolean): void source
This may be used, for example, to change the plug-in’s appearance when it is selected by the user.
Params:
Name | Type | Attribute | Description |
isSelected | boolean | If true, the plug-in is currently selected. Otherwise, it is not selected. |
Return:
void |
public webPlugInStart(): void source
The plug-in usually begins its primary task (such as drawing, playing sounds, or animating) in this method. This method may be called more than once, provided that the application has already called webPlugInInitialize() and that each call to this method is followed later by a call to webPlugInStop().
Return:
void |
public webPlugInStop(): void source
This method may be called more than once, provided that the application has already called webPlugInInitialize() and that each call to this method is preceded by a call to webPlugInStart().
Return:
void |
public willChangeValueForKey(key: string): void source
Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key is about to change.The change type of this method is NSKeyValueChangeSetting.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:) must be invoked with the same parameter. Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super.
Params:
Name | Type | Attribute | Description |
key | string | The name of the property that will change. |
Return:
void |
public willChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void source
Use this method when implementing key-value observer compliance manually.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:withSetMutation:using:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super.
Return:
void |
public willChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void source
Use this method when implementing key-value-observing compliance manually.ImportantAfter the values have been changed, a corresponding didChange(_:valuesAt:forKey:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super.
Return:
void |
public workflowControllerDidError(controller: AMWorkflowController, error: Error): void source
Invoked when the receiver's workflow encounters an error.
Params:
Name | Type | Attribute | Description |
controller | AMWorkflowController | The controller object sending the message. |
|
error | Error | If a workflow error occurs, upon return contains an instance of NSError that describes the problem. |
Return:
void |
public workflowControllerDidRun(controller: AMWorkflowController, action: AMAction): void source
Invoked when an action in the receiver's workflow is finished running.
Params:
Name | Type | Attribute | Description |
controller | AMWorkflowController | The controller object sending the message. |
|
action | AMAction | The workflow action that ran. |
Return:
void |
public workflowControllerDidStop(controller: AMWorkflowController): void source
Tells the delegate that the workflow controller object has stopped.
Params:
Name | Type | Attribute | Description |
controller | AMWorkflowController | The workflow controller object that stopped. |
Return:
void |
public workflowControllerWillRun(controller: AMWorkflowController, action: AMAction): void source
Invoked when an action in the receiver's workflow is about to run.
Params:
Name | Type | Attribute | Description |
controller | AMWorkflowController | The controller object sending the message. |
|
action | AMAction | The workflow action that will run. |
Return:
void |
public workflowControllerWillStop(controller: AMWorkflowController): void source
Tells the delegate that the workflow controller object is about to stop.
Params:
Name | Type | Attribute | Description |
controller | AMWorkflowController | The workflow controller object to be stopped. |
Return:
void |