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

UIKit crashes #6

Open
hanneskaeufler opened this issue Apr 19, 2015 · 0 comments
Open

UIKit crashes #6

hanneskaeufler opened this issue Apr 19, 2015 · 0 comments

Comments

@hanneskaeufler
Copy link

I am getting some crashreports tracing back to the theme change notification which I cannot figure out at all. maybe anyone can see whats wrong just by glancing at what I`m doing?

From the view controller where the crash is happening:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [NSNotificationCenter.defaultCenter addObserver:self
                                           selector:@selector(applyTheme)
                                               name:nil
                                             object:nil];
    // two more method calls ...
    [self applyTheme];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [NSNotificationCenter.defaultCenter removeObserver:self];
}

The report in crashlytics always shows the applyTheme method to be root of the crash, with the stacktrace showing a posted notification before.

10 Foundation   -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
Fatal Exception: NSInternalInconsistencyException
Tint view duration stack popped without matching push

This is the method:

- (void)applyTheme
{
    UIColor *tintColor = [RNThemeManager.sharedManager colorForKey:@"tintColor"];

    self.navigationController.navigationBar.barTintColor = tintColor;
    self.navigationController.navigationBar.tintColor = [RNThemeManager.sharedManager colorForKey:@"buttonTextColor"];
    self.view.tintColor = tintColor;
    self.someToolbar.barTintColor = tintColor;
    self.someOtherToolbar.barTintColor = tintColor;
}

The theme changing happens in a different view controller than the crash. I cannot reproduce the crash for the life of me. Am I chasing a UIKit bug? Is there something I´m doing wrong? Thanks for any help!

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

No branches or pull requests

1 participant