How do i fix the below coding so no breakpoint occur while running the app in simulator.
As soon as i save and run the application, it says no issues but immediately after the running process it stops and says breakpoint 3.1 4.1 errors.
#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
A breakpoint either occurs either if you set one or if there’s a runtime error. If you haven’t set a break point there, then it’s a runtime error.
Given that you mention a 3.1 4.1 error, this suggests a runtime error. You should look carefully at the line where the breakpoint occurs and see if there’s anything wrong. Also, posting where this breakpoint is will help others help you.
Not knowing where the breakpoint is, my guess is that you don’t have the movie filename correct (Remember that iOS is case sensitive) or movie1.MP4 isn’t added to the project.