UITableViewDelegate
> {
_transient Database *database_;
+ unsigned era_;
+
_H<UITableView, 2> list_;
_H<NSMutableArray> sources_;
int offset_;
}
- (Source *) sourceAtIndexPath:(NSIndexPath *)indexPath {
+@synchronized (database_) {
+ if ([database_ era] != era_)
+ return nil;
+
return [sources_ objectAtIndex:[indexPath row]];
-}
+} }
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"SourceCell";
- (void) reloadData {
[super reloadData];
+@synchronized (database_) {
+ era_ = [database_ era];
+
pkgSourceList list;
if ([database_ popErrorWithTitle:UCLocalize("SOURCES") forOperation:list.ReadMainList()])
return;
[list_ setEditing:NO];
[self updateButtonsForEditingStatus:NO animated:NO];
[list_ reloadData];
-}
+} }
- (void) showAddSourcePrompt {
UIAlertView *alert = [[[UIAlertView alloc]