I have a simple section index for a table view that appears fine for the first time but then crashes if certain kinds of interaction happens that force a redraw of the section i
It's been fixed in the 7.1 beta.
I discovered that the issue is in the function:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
There is something wrong with the section indexes algorithm after iOS 7.0, and Obviously it's a framework bug. I ended doing something like this:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
**if(IS_IOS7 || isSearching)
return nil;**
else
return [self.dictAllKeysAlphabetically allKeys];
}
This is an ugly patch which will remove the letters bar from right side of your screen, but at least your app won't crash.
I have been experiencing this exact issue. I solved this after days of frustration by using a 3rd party section index view and not using the native sectionIndexTitlesForTableView
. Check out CMIndexBar. Super easy, got it up an running in about 5 minutes. Easily customizable. This is what I will be using until Apple addresses this bug and I highly recommend it if you are experiencing this crash.
The issue seemed to have to do with a reloadData call being attempted from a background thread on a background thread, in my case. I guess the data in the view was inconsistent with the index or something like that.
Weird how it manifests itself in the form seen in the CoreText library (as seen in the stack trace above) and on iOS 7 only.
When dispatching the call on the main queue to reload the table view's data, reloading performance improved and I could use the section index again. I haven't had that crash since.
See if doing that fixes it for you.