From 3492e3eccdf0ebee0dd6d234ce2eb806990528e9 Mon Sep 17 00:00:00 2001 From: devedbox Date: Mon, 13 Mar 2017 15:22:04 +0800 Subject: [PATCH] Updated bundle access of the resources. --- .../AXWebViewController/AXWebViewController.m | 4 ++-- AXWebViewController/AppDelegate.m | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/AXWebViewController/AXWebViewController/AXWebViewController.m b/AXWebViewController/AXWebViewController/AXWebViewController.m index 34481e7..1d9c577 100644 --- a/AXWebViewController/AXWebViewController/AXWebViewController.m +++ b/AXWebViewController/AXWebViewController/AXWebViewController.m @@ -102,10 +102,10 @@ @interface _AXWebViewProgressView : NJKWebViewProgressView @end #ifndef kAX404NotFoundHTMLPath -#define kAX404NotFoundHTMLPath [[NSBundle mainBundle] pathForResource:@"AXWebViewController.bundle/html.bundle/404" ofType:@"html"] +#define kAX404NotFoundHTMLPath [[NSBundle bundleForClass:NSClassFromString(@"AXWebViewController")] pathForResource:@"AXWebViewController.bundle/html.bundle/404" ofType:@"html"] #endif #ifndef kAXNetworkErrorHTMLPath -#define kAXNetworkErrorHTMLPath [[NSBundle mainBundle] pathForResource:@"AXWebViewController.bundle/html.bundle/neterror" ofType:@"html"] +#define kAXNetworkErrorHTMLPath [[NSBundle bundleForClass:NSClassFromString(@"AXWebViewController")] pathForResource:@"AXWebViewController.bundle/html.bundle/neterror" ofType:@"html"] #endif static NSString *const kAX404NotFoundURLKey = @"ax_404_not_found"; diff --git a/AXWebViewController/AppDelegate.m b/AXWebViewController/AppDelegate.m index 5ac704d..030108d 100644 --- a/AXWebViewController/AppDelegate.m +++ b/AXWebViewController/AppDelegate.m @@ -24,6 +24,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:@"back_indicator"]]; [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"back_indicator"]]; [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -2) forBarMetrics:UIBarMetricsDefault]; + /* + NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"AXWebViewController")]; + NSString *bundlePath = [bundle pathForResource:@"AXWebViewController.bundle/html.bundle/404" ofType:@"html"]; + */ return YES; } @@ -81,4 +85,4 @@ - (BOOL)ax_canOpenURL:(NSURL *)url { - (BOOL)ax_openURL:(NSURL *)url { return [self ax_openURL:url]; } -@end \ No newline at end of file +@end