Assert that mapping is set whenever accessing

// FREEBIE
This commit is contained in:
Michael Kirk 2017-07-18 15:18:52 -04:00
parent 7adf5e81f7
commit df0cf76603
1 changed files with 11 additions and 2 deletions

View File

@ -234,8 +234,6 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
[self tableViewSetUp];
self.editingDbConnection = TSStorageManager.sharedManager.newDatabaseConnection;
// Create the database connection.
@ -243,6 +241,11 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
[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:@[
NSLocalizedString(@"WHISPER_NAV_BAR_TITLE", nil),
NSLocalizedString(@"ARCHIVE_NAV_BAR_TITLE", nil)
@ -800,6 +803,12 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
#pragma mark - Groupings
- (YapDatabaseViewMappings *)threadMappings
{
OWSAssert(_threadMappings != nil);
return _threadMappings;
}
- (void)showInboxGrouping
{
self.viewingThreadsIn = kInboxState;