MediaPlayer.framework Not working OS 2.2.1

Discussion in 'iOS Programming' started by milanjansari, Jul 8, 2009.

  1. milanjansari macrumors newbie

    Jul 8, 2009
    I'm using MediaPlayer.framework for access Music library it's works in OS 3.0 but when user run in OS 2.2.1 that time its give alert (i.e This feature not work in below 3.0 version) but when user run in OS 3.0 that its open music library.

    i have done this step.

    1) Add MediaPlayer.framework and it's Type Declare Weak
    2) Here is the code which i am using.

    onClick event
    - (void)pickASongid)sender

    Class mailClass = (NSClassFromString(@"MFMailComposeViewController") );
    if (mailClass != nil)

    MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
    picker.delegate = self;
    [self presentModalViewControllericker animated:YES];
    [picker release];

    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:mad:"OS 3.0" message:mad:"It's Not working in below 3.0" delegate:self cancelButtonTitle:mad:"ok" otherButtonTitles:nil];
    [alert show];
    [alert release];

    when I'm runing the app on my 2.2.1 device, I've got the following error:
    dyld: Symbol not found: _OBJC_CLASS_$_MPMediaQuery
    Referenced from: /var/mobile/Applications/EB544E0A-AE30-4DC8-BE9B-37B4F7C56EE2/

    Expected in: /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
    Does anyone know what i am missing?

    Thank you
  2. iphonejudy macrumors 6502


    Sep 12, 2008
    Have you checked the Framework Search Paths in Target?
  3. milanjansari thread starter macrumors newbie

    Jul 8, 2009

    i'm using below path.

  4. simplymuzik3 macrumors 6502a

    Jan 29, 2009
    Only 3.0 gives access to the iPod's music library. It's not available in 2.x

    EDIT: nevermind, I just read through your post again, I misunderstood the question.

Share This Page