Skip to content

Conversation

joelekstrom
Copy link
Contributor

@joelekstrom joelekstrom commented Jul 1, 2019

Problem:

When I for example I want to display a maximum of two items in a specific group and do this:

[mappings setRangeOptions:[YapDatabaseViewRangeOptions fixedRangeWithLength:2 offset:0 from:YapDatabaseViewBeginning] forGroup:@"group"]

there will be a bug if the group contains < N items when this call is made. Internally, YapDatabase sets the length of the range options to MIN(length, objectCount), and then forgets about this value.

This is a problem when the view and mappings are created first, and then data comes in from a network request to populate the groups. The range options will forever be 0 in length.

If this was intended, I'd love to understand why!

Solution

Never overwrite the maxLength of fixed range options

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

Successfully merging this pull request may close these issues.

1 participant