Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kingsapo

macrumors member
Original poster
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!
 

Attachments

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.
 
CarlisleUnited, THANK YOU! I get it now, I was trying to call things that weren't there. Anyways, that fixed it, so THANKS!!!!! 😀😀
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.