我试图在单个 UIWebView 中连续打开多个 URL,但它只打开最后一个 URL(最后一个成员macArray
)。
- (IBAction)openURL:(id)sender {
macArray = [NSArray arrayWithObjects:@"XX:XX:XX:XX:XX:XX", @"XX:XX:XX:XX:XX:XX", nil];
NSString *part1URL = @"http://myurl?mac=";
NSString *part2URL = @"&dothis";
for (int i = 0; i < macArray.count; i++) {
NSLog(@"%@", macArray[i]);
NSString *mac = [macArray objectAtIndex:i];
NSString *beginURL = [part1URL stringByAppendingString:mac];
NSString *URL = [beginURL stringByAppendingString:part2URL];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URL]];
[webView loadRequest:request];
}
}
有谁有想法吗?提前感谢您,祝您早日/晚安。