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

App Crashes on adding child to parent, Collapsing same parent and Expanding it again. #185

Closed maheshcs039 closed 8 years ago

maheshcs039 commented 8 years ago

I tried the example project, Step 1 : Expand the first row(Phones), Step 2 : Adding children to parent (Phones) Step 3 : Collapse the parent (Phones) Step 4 : Expand Same parent (Phones), it crashed the app says :

"fatal error: unexpectedly found nil while unwrapping an Optional value"

in "func treeView(treeView: RATreeView, cellForItem item: AnyObject?) -> UITableViewCell" Where in "item" value itself is nil

Any possible work around why its crashing?

maheshcs039 commented 8 years ago

The issue was in the DataObject.swift Replace self.children.append(child) With self.children.insert(child, atIndex: 0) It worked fine for me now...

Augustyniak commented 8 years ago

Hey,

Thanks for the report! 👍 I managed to reproduce it on my side. It should be fixed in 32f0b71dc522049483e210c765fee777d42c9e1a.

Augustyniak commented 8 years ago

Closing. 🔐 Feel free to reopen if necessary. 🙌