我想创建一个允许人们收听广播的 iPhone 应用程序。以下是我到目前为止所做的事情,但是当我点击按钮时没有任何反应,有人可以告诉我在这里做错了什么。
提前致谢。
#import <UIKit/UIKit.h>
@interface RadioViewController : UIViewController{
IBOutlet UIWebView *webView;
}
-(IBAction)radio;
@property(nonatomic,retain)UIWebView *webview;
@end
#import "RadioViewController.h"
#import <MediaPlayer/MediaPlayer.h>
@implementation RadioViewController
@synthesize webview;
-(IBAction)radio{
NSURL *url = [NSURL URLWithString:@"http://db5195728.tis.core.005.cdn.streamfarm.net:80/3212_erf_96_live.mp3"];
NSURLRequest *req = [NSURLRequest requestWithURL: url];
[webview loadRequest:req];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end