我想當前URL比較web視圖與所定義的URL說google.comUIWebView的比較當前和定義的URL與根據結果
所以理論上一個循環..
NSURLRequest *currentRequest = [webView request];
NSURL *currentURL = [currentRequest URL];
會賦予我們目前的網址...
NSString *newurl = @"http://www.google.com";
這將給我們的比較定義URL
while (!currentURL == newurl) {
//do whatever here because currentURL does not equal the newurl
}
'!a == b'表示不同於!(a == b)的'(!a)== b''。有'a!= b'。 (請注意'=='不會比較NSStrings的內容,請參閱下面的答案。) – kennytm 2010-04-22 10:29:23