I updated to OS X Lion 10.7.3 and to Xcode 4.3.2. I am unable to play a sound on the iPhone Simulator or on the iPhone device with the following code. I am able to play a sound using the same code on Snow Leopard and Xcode 4.2. I have no idea why I am not able to hear the sound in 4.3.2. Can any one help?
.h file
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
@interface soundViewController : UIViewController {
}
-(IBAction)playSounds:(id)sender;
@end
.m file
-(IBAction)playSounds:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"E", CFSTR("caf"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}