Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two childControllerContainerView's are initialized #152

Merged
merged 1 commit into from
Jan 28, 2014
Merged

Conversation

kcharwood
Copy link
Contributor

The -childControllerContainerView initializes two instances of _childControllerContainerView, both are added to the MMDrawerController's view. The issue occurs because the first initialization requests self.view.bounds. At that time self.view is nil so the view gets loaded, and viewDidLoad gets called. The viewDidLoad method sets the childControllerContainerView's background color which leads to a second initialization of childControllerContainerView because at that time the view is still nil: bildschirmfoto 2013-10-28 um 15 39 52

This can be fixed by modifying the -childControllerContainerView method to look like this:

-(UIView*)childControllerContainerView{
    if (_childControllerContainerView == nil) {
        CGRect b = self.view.bounds;
        if(_childControllerContainerView == nil) {
            _childControllerContainerView = [[UIView alloc] initWithFrame:b];
            [_childControllerContainerView setBackgroundColor:[UIColor clearColor]];
            [_childControllerContainerView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
            [self.view addSubview:_childControllerContainerView];
        }
    }
    return _childControllerContainerView;
}

@JonasGessner
Copy link
Contributor Author

Fixed in #153.

kcharwood added a commit that referenced this pull request Jan 28, 2014
Fixed Issue #152 & improved iOS 7 status bar view
kcharwood added a commit that referenced this pull request Jan 28, 2014
Two childControllerContainerView's are initialized
@kcharwood kcharwood merged commit fa2fd52 into master Jan 28, 2014
@kcharwood kcharwood deleted the bugfix_152 branch January 28, 2014 21:43
@kcharwood
Copy link
Contributor

@JonasGessner Thanks for pointing this out. I pulled into a new PR to separate the other issues you reported in #153.

This PR should fix this one.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants