Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting SIGABRT signal when I try to play a video (Objective-C)
    primarykey
    data
    text
    <p>When I try to load a video, I'm getting a SIGABRT thrown. Below is my code. If anybody could let me know why I'm getting this error, that would be great. The signal is being thrown for the line: theMovie = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];</p> <p>Two questions: what is wrong with my code? and what does SIGABRT usually mean?</p> <pre><code>#import "Video.h" #import "MyManager.h" </code></pre> <p>#import </p> <pre><code>@implementation Video MPMoviePlayerController* theMovie; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)dealloc{ [theMovie release]; [super dealloc]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; MyManager *sharedManager = [MyManager sharedManager]; NSString *tempName = sharedManager.vidName; NSString *url = [[NSBundle mainBundle] pathForResource:sharedManager.vidName ofType:@"mp4"]; theMovie = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallBack:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; theMovie.scalingMode = MPMovieScalingModeAspectFit; [theMovie.view setFrame:self.view.bounds]; [self.view addSubview:theMovie.view]; [theMovie play]; } -(void)movieFinishedCallBack:(NSNotification *) aNotification{ theMovie = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; [theMovie.view removeFromSuperview]; [theMovie pause]; [theMovie stop]; } -(void) viewWillDisappear:(BOOL)animated{ [theMovie pause]; // assume myMoviePlayer is an instance variable [theMovie stop]; theMovie = nil; [theMovie release]; } - (void)viewDidUnload { [theMovie pause]; // assume myMoviePlayer is an instance variable [theMovie stop]; theMovie = nil; [theMovie release]; [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload