【问题标题】:Playing URL of MP3 from iPhone从 iPhone 播放 MP3 的 URL 【发布时间】:2009-06-18 17:16:47 【问题描述】: 我正在努力寻找播放 mp3 网址的最佳方式。我已经尝试过 Audiostreamer,但它不适合我的需求,因为它面向无限流,而不是有限流。 感谢任何帮助! 谢谢! 【问题讨论】: 标签: iphone mp3 stream 【解决方案1】: AVAudioPlayer 是你的答案: http://developer.apple.com/iPhone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioPlayer/initWithContentsOfURL:error: 【讨论】: 如果 URL 需要传递一个 cookie 怎么办? 然后就可以使用[AVAudioPlayer initWithData]方法了。使用 NSURLRequest 通过 cookie 生成正确的请求,然后将响应保存为 NSData 对象。