I've seen a radio app, from a local radio station that has the option to play the stream in the background. So you press 开发者_高级运维the button in the app, the app closes and then Safari opens and plays the stream through Quicktime.
How is this done? I think it is a really nice feature. Was under the impression that your app cant interact with the phone in this way. Like its 'sandboxed'.
Thanks -Code
NSString *pth = @"http://www.example.com/stream.mp3";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:pth]];
Although this is not needed anymore as iOS 4 supports multitasking for all apps. Previous iOSes only supported multitasking for Safari, iPod and Mail (and Phone? dunno).
精彩评论