用到知识:1.计时器NSTimer 2.UIWebView控件 3.NSURLRequest请求数据
- (void)refreshStock
{ NSString *url = [[NSString alloc] initWithString:@"http://g.foolcdn.com/charts/advanced/caps_advanced.chart?TIME_SPAN=1Y&RESOLUTION=D&SYMBOL_US=AAPL&ID_NOTATION=&IND_1=volume&CLOSE_LINE=0"]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]; [url release]; } - (void)viewDidLoad { [super viewDidLoad]; [self refreshStock]; [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(refreshStock) userInfo:nil repeats:YES]; }
|
请发表评论