Skip to content

Commit

Permalink
* [ios] fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfeng1 committed Jun 17, 2016
1 parent 5eade9b commit e1d496c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,14 @@ - (void)createRoot:(NSDictionary *)data
_rootCSSNode->context = (__bridge void *)(self);
_rootCSSNode->children_count = 1;

__weak typeof(self) weakSelf = self;
[self _addUITask:^{
__strong typeof(self) strongSelf = weakSelf;
if (CGRectEqualToRect(instance.rootView.frame, CGRectZero)) {
CGRect newFrame = CGRectMake(WXRoundPixelValue(_rootCSSNode->layout.position[CSS_LEFT]),
WXRoundPixelValue(_rootCSSNode->layout.position[CSS_TOP]),
WXRoundPixelValue(_rootCSSNode->layout.dimensions[CSS_WIDTH]),
WXRoundPixelValue(_rootCSSNode->layout.dimensions[CSS_HEIGHT]));
CGRect newFrame = CGRectMake(WXRoundPixelValue(strongSelf->_rootCSSNode->layout.position[CSS_LEFT]),
WXRoundPixelValue(strongSelf->_rootCSSNode->layout.position[CSS_TOP]),
WXRoundPixelValue(strongSelf->_rootCSSNode->layout.dimensions[CSS_WIDTH]),
WXRoundPixelValue(strongSelf->_rootCSSNode->layout.dimensions[CSS_HEIGHT]));
instance.rootView.frame = newFrame;
}
[instance.rootView addSubview:rootComponent.view];
Expand Down Expand Up @@ -372,7 +374,6 @@ - (void)createFinish
{
WXAssertComponentThread();

WXComponent *root = [_indexDict objectForKey:WX_SDK_ROOT_REF];
WXSDKInstance *instance = self.weexInstance;
[self _addUITask:^{
UIView *rootView = instance.rootView;
Expand Down

0 comments on commit e1d496c

Please sign in to comment.