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

Inserting multiple sections 'afterSectionWithName' will raise exception. #7

Open
markst opened this issue Jun 10, 2015 · 3 comments
Open

Comments

@markst
Copy link
Contributor

markst commented Jun 10, 2015

If I wish to insert more than one section after an initial section with an animation, then all the new section indexes are added with the same index... Which raises an exception since all the new sections should have incrementing indexes.

I can provide more details if need be.

@markst
Copy link
Contributor Author

markst commented Jun 10, 2015

this is a resolution:

- (void)insertSections:(NSArray *)newSections
  afterSectionWithName:(NSString *)name
      withRowAnimation:(UITableViewRowAnimation)animation
{
    NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init];
    NSInteger insertedIndex = [self indexOfSectionWithName:name];
    for (DXTableViewSection *newSection in newSections) {
        [self insertSection:newSection atIndex:++insertedIndex];
        [indexes addIndex:insertedIndex];
    }
    [self.tableView insertSections:indexes withRowAnimation:animation];
}

@markst
Copy link
Contributor Author

markst commented Jun 10, 2015

similar issue is occurring with

- (void)deleteSectionsWithNames:(NSArray *)names withRowAnimation:(UITableViewRowAnimation)animation

@libdx
Copy link
Owner

libdx commented Jun 10, 2015

Hi markst,

Unfortunately, I don't support this project anymore (and already for a long while), the best you can do, I think, is to create your own fork and do whatever you need there. Let me know if I can help you somehow.

markst pushed a commit to Papercloud/DXTableViewModel that referenced this issue Jul 10, 2015
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