Returns an initialized output stream for writing to a specified URL.
SDKs
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (instancetype)initWithURL:(NSURL *)url append:(BOOL)shouldAppend;
Parameters
url
The URL to the file the output stream will write to.
shouldAppend
YES
if newly written data should be appended to any existing file contents, otherwiseNO
.
Return Value
An initialized output stream that can write to url
.
Discussion
The stream must be opened before it can be used.