Sequence of UI Events / Methods (Step by Step)
Hey,
I am having conflict of UIEvent and SQLite method called in the background thread via NSOperation.
UIAnimation is simple enough. Its moving a tableView, Pulling up the Keyboard (via beginResponder). All happening simultaneously and thats how I liked it. But Also a method is called via NSOperation that queries sqlite and reloads tableView in mainthread.
The problem occurs when tableView is scrolling and new data is added and I get the error : NSRangeException. index beyond bounds. and error report has references to updateVisibleCells.
To solve this I thought I would make everything happen step by step
1- Move TableView - UIAnimation
2- If the data is ready and If the tableView is scrolling Stop Scrolling programmatically and then Reload table.
All this not concurrently but one after the other.
WHat is the best possible way I can do this?
|