You might implement this method if you want to perform an asynchronous search. You would initiate the search in this method, then return NO. You would reload the table when you have results.
Showing posts with label async. Show all posts
Showing posts with label async. Show all posts
Monday, February 14, 2011
UISearchDisplayController with No Results
Don't know what it is, but I just can't make UISearchDisplayDelegate shouldReloadTableForSearchString method work the way I read the documentation:
Labels:
async,
BOOL,
NSLog,
shouldReloadTableForSearchString,
UISearchBarBackground,
UISearchDisplayController,
UISearchDisplayDelegate,
UITableView
Wednesday, January 27, 2010
Why Does UITableView Update Sometimes Crash
In some rare cases application can crash, when you do UITableView update (Out of Bounds error). This is more easy in multi-threading applications using NSMutableArray, NSMutableDictionary etc. as data source, where data source is written in non-Main thread(s) and read in Main thread for screen UI update.
Add there some asynchronous calls with automatic data change notifications just to complicate things.
Things which might help:
FIRST update your data, THEN update your table. If you cannot guarantee that, be prepared for endless debugging of just one more crash.
Add there some asynchronous calls with automatic data change notifications just to complicate things.
Things which might help:
- Random delay(s) in random places, maybe before table update starts
- @synchronized directive to control multi-thread access
- NSLock to control read/write access
- Remember index of last safe data item count
FIRST update your data, THEN update your table. If you cannot guarantee that, be prepared for endless debugging of just one more crash.
Labels:
async,
iphone,
NSLock,
NSMutableArray,
NSMutableDictionary,
thread,
UITableView
Subscribe to:
Posts (Atom)