• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems using an NSMovieView -- what am I doing wrong?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems using an NSMovieView -- what am I doing wrong?


  • Subject: Problems using an NSMovieView -- what am I doing wrong?
  • From: "Tamara L. Cravit" <email@hidden>
  • Date: Tue, 5 Nov 2002 14:32:10 -0800

Hi all,

Thanks to the recommendations of those on the list about Aaron Hillegass's
book, my first Cocoa application is coming along nicely (and I actually sort
of have my head around the Cocoa development paradigm, even.) Now, I've run
into a (I hope) small but pivotal snag, and I'm hoping someone can point me
in the right direction.

I'm trying to play a QuickTime movie from a CD-ROM inside my application,
and it's not working. I have an NSMovieView in my interface, and have
connected it to an IBOutlet in my code. Here's what I'm doing in my code:

- (IBAction) playMovie: (id) sender
{
NSMovie *movie;
NSURL *url;
NSString *urlString;

...

// CDVolumeName and MovieFilePath are defined outside of this section of
code.
urlString = [NSString stringWithFormat: @"/Volumes/%@/%@", CDVolumeName,
MovieFilePath];
url = [NSURL fileURLWithPath: urlString];

// If I NSLog the value of URL here, I get something like
// file://localhost/Volumes/MyCDName/data/movies/my_movie.mov
// which is correct, as far as I can tell.

movie = [[NSMovie alloc] initWithURL: url byReference: YES];

// At this point, movie is nil and my app blows up.

[MyMovieView setMovie: movie];
[MyMovieView setPlaysEveryFrame: NO];
[MyMovieView setVolume: 1.0];
[MyMovieView showController: YES adjustingSize: YES];
[MyMovieView start: sender;
}

If anyone can point me in the right direction, I'd greatly appreciate it.
Also, is there a way to find out WHY something failed -- like, if movie is
nil, is there something I can call to get an error code back from
initWithURL:byReference: that will tell me why it failed?

Thanks in advance!
Tamara, who's really grooving on Cocoa in spite of ripping her hair out :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Writing documentation for the help menu item (From: Bertrand Mansion <email@hidden>)

  • Prev by Date: Re: [Newbie Q] Memory Management in Cocoa
  • Next by Date: Re: NSTextView Background Color
  • Previous by thread: Re: Writing documentation for the help menu item
  • Next by thread: RE: Writing documentation for the help menu item
  • Index(es):
    • Date
    • Thread