NSSound Versus iTunes
| February 14th, 2010One of the applications I’m working on gets songs from iTunes and plays them. It doesn’t use iTunes to play the music, but just to locate them. The playing is left to NSSound. This all works fine…except when it doesn’t
It had been a bit of time since I worked on my app, and I had upgraded to Snow Leopard. While fixing new problems that popped up, one had me stumped. Every once in a while, it would just suddenly exit. It took be a bit to figure out that it was when I was trying to create an NSSound. It didn’t happen every time, and only with particular songs. Then I realized what it was: copy protected AAC files.
Sure enough, when I ran the application outside the debugger, there were no issues playing the songs in question. So, somewhere inside NSSound (I imagine pretty deep) it’s detecting that a debugger is attached and just exiting to prevent hacking the copy protection. It makes sense, but I wasn’t able to find any specific mention of this and I’m sure I never encountered this before Snow Leopard.
Perhaps it’s common knowledge and I just missed it, but I thought I’d mention it anyway. Okay, I admit, I actually first encountered it a few months ago, then again just the other day and I had forgotten what caused it. I figured if I posted about the problem it would help me remember the next time I hit it