NSStreamDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in iOS 4.0 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 iOS 2.0 and later.
  • Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSStream.h