Mac Developer Library

Developer

Foundation Framework Reference NSPortDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSPortDelegate

Inheritance


Not Applicable

Import Statement


Swift

import Foundation

Objective-C

@import Foundation;

Availability


Available in OS X v10.6 and later.

The NSPortDelegate protocol defines the optional methods implemented by delegates of NSPort objects.

  • Processes a given incoming message on the port.

    Declaration

    Swift

    optional func handlePortMessage(_ portMessage: NSPortMessage!)

    Objective-C

    - (void)handlePortMessage:(NSPortMessage *)portMessage

    Parameters

    portMessage

    An incoming port message.

    Discussion

    See NSPort Class Reference for more information.

    The delegate should implement either handlePortMessage: or the NSMachPortDelegate Protocol protocol method handleMachMessage:. You must not implement both delegate methods.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.0 and later.

    Available as part of an informal protocol prior to OS X v10.6.