Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] fix error when loading contents from cache (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he authored and cxfeng1 committed Nov 15, 2018
1 parent 69c795c commit 54a4cc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ - (void)_renderWithURL:(NSURL *)sourceURL
} else {
newURL = [NSString stringWithFormat:@"%@?random=%d", sourceURL.absoluteString, arc4random()];
}
[_instance renderWithURL:[NSURL URLWithString:newURL] options:@{@"bundleUrl":sourceURL.absoluteString} data:nil];


__weak typeof(self) weakSelf = self;
_instance.onCreate = ^(UIView *view) {
[weakSelf.weexView removeFromSuperview];
Expand All @@ -158,7 +157,9 @@ - (void)_renderWithURL:(NSURL *)sourceURL
_instance.renderFinish = ^(UIView *view) {
[weakSelf _updateInstanceState:WeexInstanceAppear];
};


[_instance renderWithURL:[NSURL URLWithString:newURL] options:@{@"bundleUrl":sourceURL.absoluteString} data:nil];

if([WXPrerenderManager isTaskReady:[self.sourceURL absoluteString]]){
WX_MONITOR_INSTANCE_PERF_START(WXPTJSDownload, _instance);
WX_MONITOR_INSTANCE_PERF_END(WXPTJSDownload, _instance);
Expand Down

0 comments on commit 54a4cc1

Please sign in to comment.