0
如何修復以下代碼,以便在模擬器中運行應用程序時不發生斷點。 只要我保存並運行應用程序,它說沒有問題,但立即在運行過程後停止並說斷點3.1 4.1錯誤。擺脫/修復斷點3.1和4.1 Xcode iOS 6
#import "XYZViewController.h"
#import <MediaPlayer/MediaPlayer.h>
@interface XYZViewController()
@end
@implementation XYZViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *movFile = [[NSBundle mainBundle]pathForResource:@"movie1" ofType:@"MP4"];
movPlayer = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL fileURLWithPath:movFile]];
movPlayer.allowsAirPlay=YES;
[movPlayer.view setFrame:CGRectMake(0, 0, 320, 480)];
[self.view addSubview:movPlayer.view];
[movPlayer play];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
感謝您的回覆。我在哪裏添加movie1.MP4對不起,我是一個新手:( – Nasir
當發生斷點錯誤時,它指向以下內容:[NSURL fileURLWithPath:movFile]]; <---- movFile – Nasir
你可以去文件>將文件添加到「<工作區名稱>」,也可以在右側的Project Navigator中右鍵單擊,或者您可以拖放文件。檢查「將項目複製到目標文件夾組」 – Thomas