【发布时间】:2014-09-25 02:27:15
【问题描述】:
在这里需要您的见解...
这一直在崩溃。我在某个站点上调用了一个表,有人说它是导致的站点,但我也可以例外。我可以在这里得到你的两分钱吗?
NSRange blockStartRange = [pageContent rangeOfString:@"\t<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" id=\"table"];
NSRange blockEndRange = [pageContent rangeOfString:@"\t</table>" options:NSBackwardsSearch range:NSMakeRange(blockStartRange.location, [pageContent length] - blockStartRange.location)];
[HTMLString appendString:[pageContent substringWithRange:NSMakeRange(blockStartRange.location, blockEndRange.location + blockEndRange.length - blockStartRange.location)]];
// [HTMLString replaceOccurrencesOfString:@"width: 700px;" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [HTMLString length])];
}
[webView loadHTMLString:HTMLString baseURL:[NSURL URLWithString:@"http://bowlatrabs.com/"]];
}
错误日志
2014-08-01 15:52:22.092 Bowl at Rabs[61401:90b] *** 由于未捕获的异常“NSRangeException”而终止应用程序,原因:“***-[__NSCFString rangeOfString:options:range:locale:]:范围 {2147483647, 2147542871} 超出范围;字符串长度 59222' *** 首先抛出调用堆栈: ( 0 核心基础 0x0270b1e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x020178e5 objc_exception_throw + 44 2 CoreFoundation 0x0270afbb +[NSException raise:format:] + 139 3 基础 0x000c38cd -[NSString rangeOfString:options:range:locale:] + 185 4 基础 0x000cf156 -[NSString rangeOfString:options:range:] + 69 Rabs 5 碗 0x0002d9e8 -[LeagueController viewDidLoad] + 920 6 UIKit 0x005dc33d-[UIViewController loadViewIfRequired] + 696 7 UIKit 0x005dc5d9 -[UIViewController 视图] + 35 8 UIKit 0x005f6942-[UINavigationController _startCustomTransition:] + 778 9 UIKit 0x006038f7-[UINavigationController _startDeferredTransitionIfNeeded:] + 688 10 UIKit 0x006044e9 -[UINavigationController __viewWillLayoutSubviews] + 57 11 UIKit 0x007450d1 -[UILayoutContainerView layoutSubviews] + 213 12 UIKit 0x0052c964-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355 13 libobjc.A.dylib 0x0202982b -[NSObject performSelector:withObject:] + 70 14 QuartzCore 0x04d9b45a -[CALayer layoutSublayers] + 148 15 石英核心 0x04d8f244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 16 石英核心 0x04d8f0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 17 石英核心 0x04cf57fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 18 石英核心 0x04cf6b85 _ZN2CA11Transaction6commitEv + 393 19 石英核心 0x04cf7258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 20 核心基础 0x026d336e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30 21 核心基础 0x026d32bf __CFRunLoopDoObservers + 399 22 核心基础 0x026b1254 __CFRunLoopRun + 1076 23 核心基础 0x026b09d3 CFRunLoopRunSpecific + 467 24 核心基础 0x026b07eb CFRunLoopRunInMode + 123 25 图形服务 0x035765ee GSEventRunModal + 192 26 图形服务 0x0357642b GSEventRun + 104 27 UIKit 0x004bdf9b UIApplicationMain + 1225 28 碗在 Rabs 0x0000239c 主要 + 76 29 libdyld.dylib 0x0325d725 开始 + 0 ) libc++abi.dylib:以 NSException 类型的未捕获异常终止 (lldb)【问题讨论】:
标签: ios objective-c ios7