iOS Question How to clear a section and add again (tableview)

tufanv

Expert
Licensed User
Longtime User
Hello,

When I use tableview.clear and add items again and reload section I get:

B4X:
<B4IExceptionWrapper: Error Domain=caught_exception Code=0 " attempt to delete section 0, but there are only 0 sections before the update" UserInfo={NSLocalizedDescription= attempt to delete section 0, but there are only 0 sections before the update}>

Even if i add the section again after tableview.clear I get this error. If i dont clear the table and keep adding records it works. So something about tableview.clear damages my code. What is wrong here?

Thanks
 

tufanv

Expert
Licensed User
Longtime User
As I see it, using TableView is a waste of time.
Use xCLV instead. It is cross platform, simpler and more customizable.

Have you called ReloadSection?
yes that has fixed the problem. Thanks for the advice
 
Upvote 0
Top