devedbox / AXWebViewController

AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.
MIT License
797 stars 133 forks source link

发现用继承的方法 调用 loadUrl ,还是现实404notFound #9

Closed LinJiaXing1102 closed 7 years ago

LinJiaXing1102 commented 7 years ago

在Xcode8上

LinJiaXing1102 commented 7 years ago

我发现注释掉viewDidLoad里面的if判断语句中的[self loadURL:[NSURL fileURLWithPath:kAX404NotFoundHTMLPath]];就可以解决了,但这明显是不行的

devedbox commented 7 years ago

麻烦提供下示例代码@linjiaxing1992

LinJiaXing1102 commented 7 years ago

一、

import <UIKit/UIKit.h>

import "AXWebViewController.h"

@interface PushViewController : AXWebViewController

@end

二、

import "PushViewController.h"

@interface PushViewController ()

@end

@implementation PushViewController

下载的demo也是继承的方法不能加载页面,直接显示404NotFound的界面

环境 :Xcode8.1 与 iOS 10.1

devedbox commented 7 years ago

需要在初始化VC的时候设置URL,注意方法的调用顺序。-loadURL只是加载一个普通的URL,并不会在加载的时候设置URL的Ivar,你可以使用KVC试试

LinJiaXing1102 commented 7 years ago

之前只是alloc init ,并没有设置url 。 已解决 谢谢

devedbox commented 7 years ago

不客气