mindz-eye/MYTableViewIndex

Calling tableViewIndex.reloadData() the second time causes infinite loop in TableViewIndex's layoutSubviews()

4tuneTeller opened this issue · 2 comments

Everything works fine if I call the following code for the first time:

self.tableView.reloadData()
self.tableIndexController.tableViewIndex.reloadData()

but after I update data source of the table view, that code makes the app freeze because layoutSubviews() gets called infinitely in TableViewIndex. But I need to update the index view, what should I do?

I've spent some time debugging and it seems that it happens because of this line in the layoutSubviews() of the TableViewIndex class:
backgroundView.frame = layout.backgroundFrame
those are never equal which triggers the layoutSubviews() again every time.

Ok, so the problem occurred because I'm modifying the background frame myself too :)