iPod Integration

Discussion in 'iOS Programming' started by kingsapo, Jun 10, 2010.

  1. kingsapo macrumors member

    Jun 10, 2010
    Hey all, I'm Matt. I'm new to the forum, but I'll get right down to my problem. I am trying to make a simple application to play songs from the iPod library. Currently, there are two buttons on the form; one is to select a song, which will start playing after you select it. The second is to pause or play the song, depending on the current playback state. My problem is, when I do anything, the app will crash. This includes selecting a new song, pausing/playing the song, even adjusting the volume with the outside buttons. I have included the program in this thread so you guys can take a look. Thanks much for any help you can provide!

    EDIT: Forgot to mention, I'm running on an iPhone 3G, 3.1.3. And no, I am not compiling for iPhone 3.2. Thanks!

    Attached Files:

  2. CarlisleUnited macrumors 6502

    Jan 30, 2007
    If you don't write methods for the methods declared in the NSNotification system the app doesn't work. Basically what happens is that you start playing a song and MPMusicPlayerControllerNowPlayingItemDidChangeNotification is triggered and it tries to call the handleNowPlayingItemChanged method which doesn't exist. If you remove the NSNotification bit or include:

    -(void)handleNowPlayingItemChanged:(id) notification{
    //Some function

    it should work.
  3. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    A skill to learn is how to read crash reports. Find out what is causing the crash and let us know.
  4. kingsapo thread starter macrumors member

    Jun 10, 2010
    CarlisleUnited, THANK YOU! I get it now, I was trying to call things that weren't there. Anyways, that fixed it, so THANKS!!!!! :D:D

Share This Page