Asynchronously checks to see if data is available.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (void)waitForDataInBackgroundAndNotifyForModes:(NSArray<NSRun Loop Mode> *)modes;
Parameters
modes
The runloop modes in which the data available notification can be posted.
Discussion
When the data becomes available, this method posts a NSFile
notification on the current thread. This method differs from wait
in that modes
specifies the run-loop mode (or modes) in which NSFile
can be posted.
You must call this method from a thread that has an active run loop.