readInBackgroundAndNotify
バックグラウンドでファイルを読んで、読み終わったら通知します
解説
バックグラウンドでファイルを読んで、読み終わったら通知します。
非同期で、ファイル又は通信チャンネルにavailableDataの処理を行い、クライアントプロセスの実行ループにNSFileHandleReadCompletionNotificationをポストします。
データの長さは使用されているOSのバッファサイズによって制限されます。
通知は読み込んだデータが格納されているuserInfoが含まれています。このオブジェクトにアクセスする場合はNSFileHandleNotificationDataItemを使います。
●NSFileHandleReadCompletionNotificationのuserInfo
NSFileHandleNotificationDataItem ソケット接続から読み込むことができるデータ(NSData)
NSFileHandleNotificationMonitorModes 通知をポストすることができる実行ループの配列(NSArray)
返り値
( void )
なし
引数
フレームワーク
Foundation
クラス
NSFileHandle
Instance Methods
使用可能
10.0
参照
- acceptConnectionInBackgroundAndNotify
- readToEndOfFileInBackgroundAndNotifyForModes:
- enqueueNotification:postingStyle:coalesceMask:forModes:(NSNotificationQueue)
例文
//バックグラウンドで読んで通知 [handle3 seekToFileOffset:0]; [handle3 readInBackgroundAndNotify];