Instance Method


Adds a port as an input source to the specified mode of the run loop.


- (void)addPort:(NSPort *)aPort forMode:(NSRunLoopMode)mode;



The port to add to the receiver.


The mode in which to add aPort. You may specify a custom mode or use one of the modes listed in Run Loop Modes.


This method schedules the port with the receiver. You can add a port to multiple input modes. When the receiver is running in the specified mode, it dispatches messages destined for that port to the port’s designated handler routine.

See Also

Managing Ports

- removePort:forMode:

Removes a port from the specified input mode of the run loop.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software