views:

2499

answers:

2

Hi i have the following error in my code error:cannot find protocol declaration for MPMusicPlayerController and am completely stumped as to what it means.

Any insight into this is greatly appreciated.

A: 
  1. Add mediaPlayer framework to your project

2 add #import to your class file

EDIT : This code compiled without errors (for OS 3.0)

#import "UntitledAppDelegate.h"
#import <MediaPlayer/MediaPlayer.h>

@implementation UntitledAppDelegate

@synthesize window;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    MPMusicPlayerController *mc;
    [window makeKeyAndVisible];
}

@end

oxigen
Thanks for the response but I've got the framework loaded into the Resource folder and I've imported the <MediaPlayer/MediaPlayer.h> file into the header of the view controller I want to use.
Gavin O'Brien
hm... May be you use SDK 2.2.1 ?MPMusicPlayerController available in iPhone OS 3.0
oxigen
Gavin, did you find a solution for this? I'm running into same error and can't get around it. Thanks.
subjective-c
+2  A: 

I had the same issue. Maybe you don't have the framework linked in the project?

Right-click your Target file on Groups & Files in XCode. On the window that opens there will be a list of Linked Libraries. Click + and add MediaPlayer.framework

leolobato