我有2个循环,如下面的代码:
for(NSString *link in pageLinks){
for(NSString *pattern in disallowedPattern){
if (range.location != NSNotFound )
// if condition is yes go back to the first loop.
}
}
Run Code Online (Sandbox Code Playgroud)
如果条件为是,我希望程序返回第一个循环.我用过continue,但它只是返回到第二个循环.这是什么解决方案?
想象一下这是我的网址
NSURL *theURL=[NSURL URLWithString:@"http://stackoverflow.com/questions/ask"];
Run Code Online (Sandbox Code Playgroud)
我怎样才能提取:
http://stackoverflow.com
Run Code Online (Sandbox Code Playgroud)
?