あなたはcheck Reachability
statusにアプリを設定し、「一時停止」を送信することがありますNSNotification
ときに、ネットワークの状態の変化やネットワークが到達不能(および、同様に、NSNotification
とき「再生」でありますネットワークステータスの変更、およびネットワークは今再び到達可能である):
[[Reachability sharedReachability] setNetworkStatusNotificationsEnabled:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:@"kNetworkReachabilityChangedNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pauseStreaming:) name:@"kPauseAudioStreamingIfPlaying" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pauseStreaming:) name:@"kPlayAudioStreamingIfPaused" object:nil];
- (void) reachabilityChanged:(id)sender {
NetworkStatus reachabilityStatus = [[Reachability sharedReachability] internetConnectionStatus];
if (reachabilityStatus == NotReachable)
[[NSNotificationCenter defaultCenter] postNotificationName:@"kPauseAudioStreamingIfPlaying" object:nil];
else
[[NSNotificationCenter defaultCenter] postNotificationName:@"kPlayAudioStreamingIfPaused" object:nil];
}
こんにちは、アレックス、任意のエラーbytes..Wheneverストリームを読み取るためCFNetworkはフレームワークを使用していreply..Iあなたのため おかげかもしれreadstream通話機能を発生します私は遊びを再開できません。ストリームデータを取得するためにreadstreamコールバックをリセットする方法を知っていますか? –
Googleが「ASIHTTPRequest」を検索して、データ要求の読み取りと再開を容易にするフレームワークを提供します。これはあなたを助けるかもしれません(あるいはそうでないかもしれません)。あるいは、少なくとも生のソースコードを使ってCopseyがそれをどうやって行うのを助けるかもしれません。 –