UIWebView initwithFrame崩溃我的应用程序

时间:2015-10-19 13:16:59

标签: ios objective-c uiwebview

1)我将webView声明为具有强属性(强)的属性viewDidLoad;

2)在_webView方法中,我正在检查我的网络常量是否存在。基于此,我将使用名为[[UIWebView alloc] initWithFrame:];

的webView属性的隐式常量创建

3)然后_webView提供给- (void)viewDidLoad { [super viewDidLoad]; [self setBaseNaviBarInfo]; if (_webInfoDictionary.count > 0) { NSString *titile = [_webInfoDictionary objectForKey:@"activityName"]; [self setNaviItemText:titile]; } [self createViews]; CLS_LOG(@"init create wb view ......"); NSString* url = [_webInfoDictionary objectForKey:@"activityLink"]; [self loadWebViewWithURLString:url]; } -(void)createViews{ if (!_webView) { //Crash Now _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, STATUS_NAVI_STATUS_HEIGHT, IPHONE_WIDTH, IPHONE_HEIGHT - STATUS_NAVI_STATUS_HEIGHT)]; _webView.delegate = self; _webView.scalesPageToFit = NO; _webView.dataDetectorTypes = UIDataDetectorTypeNone; [self.view addSubview:_webView]; _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame : CGRectMake(0.0f, 0.0f, 32.0f, 32.0f)] ; [_activityIndicatorView setCenter: self.view.center] ; [_activityIndicatorView setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleGray] ; [self.view addSubview : _activityIndicatorView]; } } ;

4)最后有时它会在iOS 8或iOS 9或iOS7平台上崩溃,我在此处发布了来自Fabric CrashReport的图片;

{{1}}

Crash Reference

0 个答案:

没有答案