NSStreamDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in OS X v10.6 and later.
Companion guide
Declared in
NSStream.h
Related sample code

Overview

The NSStreamDelegate protocol defines the optional methods implemented by delegates of NSStream objects.

Tasks

Using Streams

Instance Methods

stream:handleEvent:

The delegate receives this message when a given event has occurred on a given stream.

- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent
Parameters
theStream

The stream on which streamEvent occurred.

streamEvent

The stream event that occurred.

Discussion

The delegate receives this message only if theStream is scheduled on a run loop. The message is sent on the stream object’s thread. The delegate should examine streamEvent to determine the appropriate action it should take.

Availability
  • Available in OS X v10.3 and later.
  • Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSStream.h