views:

81

answers:

1

I have the following code:

(void)loadStateChanged:(NSNotification*)notification
{
     if ([[movie attributeForKey:QTMovieLoadStateAttribute] longValue] >= kMovieLoadStatePlayable)
     {
      [[NSNotificationCenter defaultCenter] removeObserver:self];

      long movieScale = [[movie attributeForKey:QTMovieTimeScaleAttribute] longValue];

      [movie setCurrentTime:QTMakeTime(0, movieScale)];

      [movie play];
 }

and it is throwing this error:

error: 'kMovieLoadStatePlayable' undeclared (first use in this function)

I believe that kMovieLoadStatePlayable belongs to a QuickTime framework, and I have both QTKit and and the QuickTime framework in my program, but I can't figure out why it is erroring here. I know it is something to do with these frameworks.

+1  A: 

Is there an #import in the source file in which you use this symbol?

Just dragging a framework into your project doesn't make its headers available to every source file (that would signficiantly slow down compilation). You have to explicitly include the umbrella header for every framework that each source file uses.

If you are assured that you'll use a framework in every source file, then add an #import to your Prefix Header.

cdespinosa
To further elaborate on the answer given by cdespinosa. This symbol is defined in Movies.h in QuickTime.framework. To import this you would use the line:#import <QuickTime/Movies.h>Typically near the top of the file.
Jon Steinmetz