-(IBAction)play2;
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef =CFBundleCopyResourceURL(mainBundle,
CFBundleCopyResourceURL
contains copy so your retain count on soundFileURLRef
is in fact 1. When you are done with it call CFRelease(soundFileURLRef)
to decrement your retain count.
In addition to the error you're getting, SAKrisT's answer about calling AudioServicesDisposeSystemSoundID
on the object you created with AudioServicesCreateSystemSoundID
is also something to address.