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

setHiddenKeys not working with radio groups and animated=YES #289

Closed
mournblade opened this issue Feb 5, 2015 · 2 comments
Closed

setHiddenKeys not working with radio groups and animated=YES #289

mournblade opened this issue Feb 5, 2015 · 2 comments

Comments

@mournblade
Copy link

Hello,

trying to show/hide some elements based on a radio button switch. So i do just like in the example, in settingDidChange.

- (void)settingDidChange:(NSNotification *)notification {
    if ([notification.object isEqual:NOTIFICATIONS_IDENTIFIER]) {
        int enabled = [[notification.userInfo objectForKey:NOTIFICATIONS_IDENTIFIER] intValue];
        [self setHiddenKeys:(enabled == 2) ? nil : [NSSet setWithObjects:@"notificationSpecifyUsers", @"notificationSpecifyLocations", nil] animated:true];
    }
}

However, while this works with animated;false, my app crashes if i try to have animated:true.

it crashes on row 319 in IASKsettingsviewcontroller:

[self.tableView endUpdates];

2015-02-05 13:19:02.192 nuba[5169:2453058] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (2), plus or minus the number of sections inserted or deleted (1 inserted, 0 deleted).'

This is with the latest version released today.

EDIT: this is in a child pane... :)

@futuretap futuretap changed the title sethiddenkeys not working with animation setHiddenKeys not working with radio groups and animated=YES Feb 25, 2015
@futuretap
Copy link
Owner

Please check if the issue persists in the latest update and create a new issue if needed.

@mournblade
Copy link
Author

mournblade commented Oct 10, 2023

FYI, this issue is back for me, but the other way around.

consider this method:

- (void)updateVisibilityItems {
    NSMutableSet *set = CacheHandler.cache.isAdminOrManager ? [NSMutableSet set] : [NSMutableSet setWithArray:@[@"push_notifications", @"com.a.STATUS", @"accAlarmNot", @"accAlarmNotHeader", @"accEmail", @"accEmailHeader"]];

    if (([prefs getCheckingInGeofenceActionType] == OFF)) {
        [set addObject:@"geoChangePolicyGrp"];
    }
    [self setHiddenKeys:set animated:true];//CRASHES IF FALSE
    DebugLog(@"updateVisibilityItems");
}

if I call this when my kIASKAppSettingChanged observer is called, it crashes if animated is false. Version 3.4

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

2 participants