0
我測試此代碼在我的iphone在飛行模式,當我clik按鈕上顯示一個味精,但在我連接到互聯網的狀態,播放按鈕不起作用,我的應用程序退出問題在可達性
這是代碼:
-(void)playMovie {
NSURL *url = [NSURL URLWithString:@"http://www.tvlaayoune.com/iphone/jt.mp4"];
UIAlertView *errorView;
if ([[Reachability sharedReachability]
internetConnectionStatus] == NotReachable) {
errorView = [[UIAlertView alloc]
initWithTitle: @"Unable To Connect To Server"
message: @"Check your network connection and try again."
delegate: self
cancelButtonTitle: @"OK"
otherButtonTitles: nil];
} else {
moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
} [errorView show];
}
可以採取什麼問題嗎?
的問題是,你不要引用顯示在您的日誌一旦應用程序退出的問題。此外,您不會引用應在調試器中可見的堆棧跟蹤。 – Till