I am playing audio in iphone app but problem is that it works fine on simulator but it is not working on device here is my code it just closes the app when this code runs.
First add AVFoundation.framework and add below code.
in .h file
#import
and .m file
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];