Augustyniak / RATreeView

Library providing easy-to-use interface for displaying tree structures on iOS and tvOS.
MIT License
2.49k stars 465 forks source link

Fix duplicate cells bug #107

Closed Fogh closed 9 years ago

Fogh commented 9 years ago

Seems like a missing exclamation mark was causing the bug.

Fixes #105 for me.

abbasmousavi commented 9 years ago

+1 for this pull request

Augustyniak commented 9 years ago

This PR breaks collapsing of the cells. After cell is collapsed you have to tap twice to expand it again.

Fogh commented 9 years ago

I'm using this fix in an app. I have no problem with expanding rows. They expand on first tap.

Augustyniak commented 9 years ago

What about the test project? I tried your fixed there and the results are as I described.

Fogh commented 9 years ago

You're right. It doesn't seem to work in the test project. That is stange, since I used the test project to implement it in the app where I have it working.

abbasmousavi commented 9 years ago

It seems that the problem has fixed in 1.0.2 (without this fix).

gtgg commented 9 years ago

This problem still in 1.0.2

Fogh commented 9 years ago

The problem still occurs in 1.0.2 for me as well.

Augustyniak commented 9 years ago

The problem is that the test project works fine for me. @Fogh @gtgg Ok, can you provide me with more information? Do you use swift or objective-c? Any big differences between the way test project uses RATreeView and the way your projects uses it?

abbasmousavi commented 9 years ago

This duplicate effect can happen if you generate new object every time ratreeview asks you for children of a specific item. Ratreeview uses address of objects so every time you should provide exact same objects. @fog @gtgg

Augustyniak commented 9 years ago

@abbasmousavi That's a good point :+1:

gtgg commented 9 years ago

@Augustyniak @abbasmousavi @Fogh you are right.But I can't provide exact same objects。So i think this problem need solve.

Fogh commented 9 years ago

@abbasmousavi You are right! I load data from a SQLite database, so I don't use the same objects.

gtgg commented 9 years ago

@Augustyniak @Fogh i can't provide exact same objects. I get children of specific item from net. RATreeView is work-well on 0.9.2。 So, i still need some help to fix this problem,please.

Augustyniak commented 9 years ago

@Fogh @gtgg @abbasmousavi Version 1.0.3 has been released. It should fix the problem with duplicated cells even if provided objects change between collapse/expand operations.

Please let me know whether new version behave correctly in your cases.

abbasmousavi commented 9 years ago

@Augustyniak, I provide same objects every time and yes, 1.0.3 behaves correctly in my case. Thanks for the update.