這是爲什麼會崩潰?可可不能在第一個索引之後訪問數組元素?
NSArray *domain = [webView.request.URL.absoluteString componentsSeparatedByString:@"/"];
NSString *str1 = [domain objectAtIndex:2];
這是我的錯誤:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSArray objectAtIndex:]: index 2 beyond bounds [0 .. 0]'
我能夠使用objectAtIndex:0就好了。
這不是任何標準的C++。 – wilhelmtell
@All:關於2.問題,請忽略它,不要開始任何火焰之戰。謝謝! – Phlibbo