i am trying to play an mp3 audio file, the file will be uploaded by user on web server and i will get the url of that file and then i have to play that file but i am not succeeding in it. here is my code
NSURL *url = [NSURL URLWithString:url1]; NSData *theData = [NSData dataWithContentsOfURL:url]; newPlayer = [[AVAudioPlayer alloc] initWithData:theData error:nil]; [newPlayer play];
the url is like this
http://mqm.designers99.com/Notification/mp3_files/1331551313_1919.mp3
Plz. guide me coz i am stuck here, thanx and regards
-initWithData:error:
instance method for this, you could just use-initWithContentsOfURL:error:
– basvk