这是我当前的代码:
int i = 1;
NSString * StockOneYahooFinance = [NSString stringWithFormat:@"http://finance.yahoo.com/q/hp?s=S+Historical+Prices"];
NSString * PulledStockOne = [NSString stringWithContentsOfURL:[NSURL URLWithString:StockOneYahooFinance] encoding:1 error:nil];
for (i=1;i=30;i++){
NSString *StartPulling = [[PulledStockOne componentsSeparatedByString:@"nowrap align="] objectAtIndex:i];
NSString *StartOpen = [[StartPulling componentsSeparatedByString:@">"] objectAtIndex:3];
NSString *Open = [[StartOpen componentsSeparatedByString:@"<"] objectAtIndex:0];
NSString *StartClose = [[StartPulling componentsSeparatedByString:@">"] objectAtIndex:9];
NSString *Close = [[StartClose componentsSeparatedByString:@"<"] objectAtIndex:0];
year.text = Close;
i++;
}
但到了这一点,我点击屏幕上唯一的按钮,它完全按照我想要的方式拉动了当天的股票开盘价和收盘价。但是我当前的问题是我希望它把所有这些都拉成一个数组,那么我该怎么做呢?