You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/08/17 02:37:05 UTC

incubator-weex git commit: * [ios] use viewController as pageName

Repository: incubator-weex
Updated Branches:
  refs/heads/0.16-dev 45d52c866 -> 63dc11407


* [ios] use viewController as pageName


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/63dc1140
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/63dc1140
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/63dc1140

Branch: refs/heads/0.16-dev
Commit: 63dc11407aa6d1f2e766d14e1f1ffe6c008c33a6
Parents: 45d52c8
Author: acton393 <zh...@gmail.com>
Authored: Thu Aug 17 10:37:20 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Aug 17 10:37:20 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/63dc1140/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index b593621..226b808 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -175,12 +175,16 @@ typedef enum : NSUInteger {
     if (![WXUtility isBlankString:self.pageName]) {
         WXLog(@"Start rendering page:%@", self.pageName);
     } else {
-        WXLogWarning(@"WXSDKInstance's pageName should be specified.");
-        id<WXJSExceptionProtocol> jsExceptionHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXJSExceptionProtocol)];
-        if ([jsExceptionHandler respondsToSelector:@selector(onRuntimeCheckException:)]) {
-            WXRuntimeCheckException * runtimeCheckException = [WXRuntimeCheckException new];
-            runtimeCheckException.exception = @"We highly recommend you to set pageName.\n Using WXSDKInstance * instance = [WXSDKInstance new]; instance.pageName = @\"your page name\" to fix it";
-            [jsExceptionHandler onRuntimeCheckException:runtimeCheckException];
+        if (self.viewController) {
+            self.pageName = NSStringFromClass([self.viewController class]);
+        } else {
+            WXLogWarning(@"WXSDKInstance's pageName should be specified.");
+            id<WXJSExceptionProtocol> jsExceptionHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXJSExceptionProtocol)];
+            if ([jsExceptionHandler respondsToSelector:@selector(onRuntimeCheckException:)]) {
+                WXRuntimeCheckException * runtimeCheckException = [WXRuntimeCheckException new];
+                runtimeCheckException.exception = @"We highly recommend you to set pageName.\n Using WXSDKInstance * instance = [WXSDKInstance new]; instance.pageName = @\"your page name\" to fix it";
+                [jsExceptionHandler onRuntimeCheckException:runtimeCheckException];
+            }
         }
     }