Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: wallabie on June 23, 2014, 12:27:36 AM
-
I have a SV with a table that's being dynamically populated again and again with new info with fresh data.
I need a way to immediately clear out all of the data from the table when fresh data comes in. Looking at the UiTable code, there's not an immediate way of clearing the mChildren list. Seems only on the next update.
-
GetComponent<UITable>().children.Clear();
-
Ah, seems like the problem is that I was testing using Destroy and it didn't work.
Had to do destroyImmediately for the table to recognize that there are no more children.
-
Object.Destroy() doesn't remove children. It's a delayed process. DestroyImmediate should only be used at edit time as per Unity's docs.
Use NGUITools.Destroy instead.
-
Thanks for this Tip.