Assert that mapping is set whenever accessing

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 7adf5e81f7
commit df0cf76603

@ -234,8 +234,6 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[super viewDidLoad]; [super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO]; [self.navigationController.navigationBar setTranslucent:NO];
[self tableViewSetUp];
self.editingDbConnection = TSStorageManager.sharedManager.newDatabaseConnection; self.editingDbConnection = TSStorageManager.sharedManager.newDatabaseConnection;
// Create the database connection. // Create the database connection.
@ -243,6 +241,11 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[self showInboxGrouping]; [self showInboxGrouping];
// because this uses the table data source, `tableViewSetup` must happen
// after mappings have been set up in `showInboxGrouping`
[self tableViewSetUp];
self.segmentedControl = [[UISegmentedControl alloc] initWithItems:@[ self.segmentedControl = [[UISegmentedControl alloc] initWithItems:@[
NSLocalizedString(@"WHISPER_NAV_BAR_TITLE", nil), NSLocalizedString(@"WHISPER_NAV_BAR_TITLE", nil),
NSLocalizedString(@"ARCHIVE_NAV_BAR_TITLE", nil) NSLocalizedString(@"ARCHIVE_NAV_BAR_TITLE", nil)
@ -800,6 +803,12 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
#pragma mark - Groupings #pragma mark - Groupings
- (YapDatabaseViewMappings *)threadMappings
{
OWSAssert(_threadMappings != nil);
return _threadMappings;
}
- (void)showInboxGrouping - (void)showInboxGrouping
{ {
self.viewingThreadsIn = kInboxState; self.viewingThreadsIn = kInboxState;

Loading…
Cancel
Save