Fix many leaks in the view controllers.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-07-25 13:56:16 -04:00
parent f0cecfad11
commit c1139a3a28
11 changed files with 64 additions and 61 deletions

View File

@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
[loggingSection [loggingSection
addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"") addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"")
actionBlock:^{ actionBlock:^{
DDLogInfo(@"%@ Submitting debug logs", self.tag); DDLogInfo(@"%@ Submitting debug logs", weakSelf.tag);
[DDLog flushLog]; [DDLog flushLog];
[Pastelog submitLogs]; [Pastelog submitLogs];
}]]; }]];

View File

@ -74,8 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
@"A label for the 'add phone number' button in the block list table.") @"A label for the 'add phone number' button in the block list table.")
actionBlock:^{ actionBlock:^{
AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init]; AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
[weakSelf.navigationController pushViewController:vc animated:YES]; [weakSelf.navigationController pushViewController:vc animated:YES];
}]]; }]];
[contents addSection:addSection]; [contents addSection:addSection];

View File

@ -216,7 +216,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[nonContactsSection [nonContactsSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
NewGroupViewController *strongSelf = weakSelf; NewGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId];
@ -309,7 +309,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[signalAccountSection [signalAccountSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
NewGroupViewController *strongSelf = weakSelf; NewGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];

View File

@ -271,9 +271,11 @@ NS_ASSUME_NONNULL_BEGIN
iconName:@"table_ic_add_to_existing_contact"]; iconName:@"table_ic_add_to_existing_contact"];
} }
actionBlock:^{ actionBlock:^{
TSContactThread *contactThread = (TSContactThread *)self.thread; OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
TSContactThread *contactThread = (TSContactThread *)strongSelf.thread;
NSString *recipientId = contactThread.contactIdentifier; NSString *recipientId = contactThread.contactIdentifier;
[weakSelf presentAddToContactViewControllerWithRecipientId:recipientId]; [strongSelf presentAddToContactViewControllerWithRecipientId:recipientId];
}]]; }]];
} }
@ -293,6 +295,8 @@ NS_ASSUME_NONNULL_BEGIN
[mainSection [mainSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
@ -303,7 +307,7 @@ NS_ASSUME_NONNULL_BEGIN
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight]; [topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_hourglass"];
[topView addSubview:iconView]; [topView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
@ -318,8 +322,8 @@ NS_ASSUME_NONNULL_BEGIN
[rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing]; [rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing];
UISwitch *switchView = [UISwitch new]; UISwitch *switchView = [UISwitch new];
switchView.on = self.disappearingMessagesConfiguration.isEnabled; switchView.on = strongSelf.disappearingMessagesConfiguration.isEnabled;
[switchView addTarget:self [switchView addTarget:strongSelf
action:@selector(disappearingMessagesSwitchValueDidChange:) action:@selector(disappearingMessagesSwitchValueDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[topView addSubview:switchView]; [topView addSubview:switchView];
@ -350,6 +354,8 @@ NS_ASSUME_NONNULL_BEGIN
addItem:[OWSTableItem addItem:[OWSTableItem
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
@ -360,13 +366,13 @@ NS_ASSUME_NONNULL_BEGIN
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight]; [topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_hourglass"];
[topView addSubview:iconView]; [topView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
UILabel *rowLabel = self.disappearingMessagesDurationLabel; UILabel *rowLabel = strongSelf.disappearingMessagesDurationLabel;
[self updateDisappearingMessagesDurationLabel]; [strongSelf updateDisappearingMessagesDurationLabel];
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_footnoteFont]; rowLabel.font = [UIFont ows_footnoteFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
@ -375,11 +381,11 @@ NS_ASSUME_NONNULL_BEGIN
[rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing]; [rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing];
UISlider *slider = [UISlider new]; UISlider *slider = [UISlider new];
slider.maximumValue = (float)(self.disappearingMessagesDurations.count - 1); slider.maximumValue = (float)(strongSelf.disappearingMessagesDurations.count - 1);
slider.minimumValue = 0; slider.minimumValue = 0;
slider.continuous = YES; // NO fires change event only once you let go slider.continuous = YES; // NO fires change event only once you let go
slider.value = self.disappearingMessagesConfiguration.durationIndex; slider.value = strongSelf.disappearingMessagesConfiguration.durationIndex;
[slider addTarget:self [slider addTarget:strongSelf
action:@selector(durationSliderDidChange:) action:@selector(durationSliderDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[cell.contentView addSubview:slider]; [cell.contentView addSubview:slider];
@ -436,11 +442,13 @@ NS_ASSUME_NONNULL_BEGIN
OWSTableSection *muteSection = [OWSTableSection new]; OWSTableSection *muteSection = [OWSTableSection new];
[muteSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [muteSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIImageView *iconView = [self viewForIconWithName:@"table_ic_mute_thread"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_mute_thread"];
[cell.contentView addSubview:iconView]; [cell.contentView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
@ -457,7 +465,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *muteStatus = NSLocalizedString( NSString *muteStatus = NSLocalizedString(
@"CONVERSATION_SETTINGS_MUTE_NOT_MUTED", @"Indicates that the current thread is not muted."); @"CONVERSATION_SETTINGS_MUTE_NOT_MUTED", @"Indicates that the current thread is not muted.");
NSDate *mutedUntilDate = self.thread.mutedUntilDate; NSDate *mutedUntilDate = strongSelf.thread.mutedUntilDate;
NSDate *now = [NSDate date]; NSDate *now = [NSDate date];
if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) { if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) {
NSCalendar *calendar = [NSCalendar currentCalendar]; NSCalendar *calendar = [NSCalendar currentCalendar];
@ -506,11 +514,13 @@ NS_ASSUME_NONNULL_BEGIN
[weakSelf disclosureCellWithName:NSLocalizedString(@"CONVERSATION_SETTINGS_BLOCK_THIS_USER", [weakSelf disclosureCellWithName:NSLocalizedString(@"CONVERSATION_SETTINGS_BLOCK_THIS_USER",
@"table cell label in conversation settings") @"table cell label in conversation settings")
iconName:@"table_ic_block"]; iconName:@"table_ic_block"];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
UISwitch *blockUserSwitch = [UISwitch new]; UISwitch *blockUserSwitch = [UISwitch new];
blockUserSwitch.on = isBlocked; blockUserSwitch.on = isBlocked;
[blockUserSwitch addTarget:self [blockUserSwitch addTarget:strongSelf
action:@selector(blockUserSwitchDidChange:) action:@selector(blockUserSwitchDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
cell.accessoryView = blockUserSwitch; cell.accessoryView = blockUserSwitch;
@ -521,7 +531,6 @@ NS_ASSUME_NONNULL_BEGIN
} }
self.contents = contents; self.contents = contents;
[self.tableView reloadData];
} }
- (CGFloat)iconSpacing - (CGFloat)iconSpacing
@ -892,7 +901,7 @@ NS_ASSUME_NONNULL_BEGIN
{ {
self.disappearingMessagesConfiguration.enabled = flag; self.disappearingMessagesConfiguration.enabled = flag;
[self.tableView reloadData]; [self updateTableContents];
} }
- (void)durationSliderDidChange:(UISlider *)slider - (void)durationSliderDidChange:(UISlider *)slider
@ -1045,7 +1054,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setThreadMutedUntilDate:(nullable NSDate *)value - (void)setThreadMutedUntilDate:(nullable NSDate *)value
{ {
[self.thread updateWithMutedUntilDate:value]; [self.thread updateWithMutedUntilDate:value];
[self.tableView reloadData]; [self updateTableContents];
} }
#pragma mark - Notifications #pragma mark - Notifications

View File

@ -282,10 +282,12 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
selector:(SEL)selector selector:(SEL)selector
{ {
OWSAssert(text.length > 0); OWSAssert(text.length > 0);
OWSAssert(target);
OWSAssert(selector); OWSAssert(selector);
OWSTableItem *item = [OWSTableItem new]; OWSTableItem *item = [OWSTableItem new];
item.itemType = OWSTableItemTypeAction; item.itemType = OWSTableItemTypeAction;
__weak id weakTarget = target;
item.customCellBlock = ^{ item.customCellBlock = ^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
cell.textLabel.text = text; cell.textLabel.text = text;
@ -295,7 +297,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
UISwitch *cellSwitch = [UISwitch new]; UISwitch *cellSwitch = [UISwitch new];
cell.accessoryView = cellSwitch; cell.accessoryView = cellSwitch;
[cellSwitch setOn:isOn]; [cellSwitch setOn:isOn];
[cellSwitch addTarget:target action:selector forControlEvents:UIControlEventValueChanged]; [cellSwitch addTarget:weakTarget action:selector forControlEvents:UIControlEventValueChanged];
cellSwitch.enabled = isEnabled; cellSwitch.enabled = isEnabled;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;

View File

@ -96,7 +96,6 @@ NS_ASSUME_NONNULL_BEGIN
}]]; }]];
[contents addSection:historyLogsSection]; [contents addSection:historyLogsSection];
self.contents = contents; self.contents = contents;
} }

View File

@ -446,7 +446,6 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
- (void)updateTableContents - (void)updateTableContents
{ {
OWSTableContents *contents = [OWSTableContents new]; OWSTableContents *contents = [OWSTableContents new];
__weak SelectRecipientViewController *weakSelf = self; __weak SelectRecipientViewController *weakSelf = self;
ContactsViewHelper *helper = self.contactsViewHelper; ContactsViewHelper *helper = self.contactsViewHelper;
@ -458,57 +457,59 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
const CGFloat kButtonRowHeight = 60; const CGFloat kButtonRowHeight = 60;
[phoneNumberSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [phoneNumberSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectRecipientViewController *strongSelf = weakSelf; SelectRecipientViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
// Country Row // Country Row
UIView *countryRow = [self createRowWithHeight:kCountryRowHeight previousRow:nil superview:cell.contentView]; UIView *countryRow =
[countryRow addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self [strongSelf createRowWithHeight:kCountryRowHeight previousRow:nil superview:cell.contentView];
[countryRow addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:strongSelf
action:@selector(countryRowTouched:)]]; action:@selector(countryRowTouched:)]];
UILabel *countryCodeLabel = self.countryCodeLabel; UILabel *countryCodeLabel = strongSelf.countryCodeLabel;
[countryRow addSubview:countryCodeLabel]; [countryRow addSubview:countryCodeLabel];
[countryCodeLabel autoPinLeadingToSuperView]; [countryCodeLabel autoPinLeadingToSuperView];
[countryCodeLabel autoVCenterInSuperview]; [countryCodeLabel autoVCenterInSuperview];
[countryRow addSubview:self.countryCodeButton]; [countryRow addSubview:strongSelf.countryCodeButton];
[self.countryCodeButton autoPinTrailingToSuperView]; [strongSelf.countryCodeButton autoPinTrailingToSuperView];
[self.countryCodeButton autoVCenterInSuperview]; [strongSelf.countryCodeButton autoVCenterInSuperview];
// Phone Number Row // Phone Number Row
UIView *phoneNumberRow = UIView *phoneNumberRow =
[self createRowWithHeight:kPhoneNumberRowHeight previousRow:countryRow superview:cell.contentView]; [strongSelf createRowWithHeight:kPhoneNumberRowHeight previousRow:countryRow superview:cell.contentView];
[phoneNumberRow [phoneNumberRow
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:strongSelf
action:@selector(phoneNumberRowTouched:)]]; action:@selector(phoneNumberRowTouched:)]];
UILabel *phoneNumberLabel = self.phoneNumberLabel; UILabel *phoneNumberLabel = strongSelf.phoneNumberLabel;
[phoneNumberRow addSubview:phoneNumberLabel]; [phoneNumberRow addSubview:phoneNumberLabel];
[phoneNumberLabel autoPinLeadingToSuperView]; [phoneNumberLabel autoPinLeadingToSuperView];
[phoneNumberLabel autoVCenterInSuperview]; [phoneNumberLabel autoVCenterInSuperview];
[phoneNumberRow addSubview:self.phoneNumberTextField]; [phoneNumberRow addSubview:strongSelf.phoneNumberTextField];
[self.phoneNumberTextField autoPinLeadingToTrailingOfView:phoneNumberLabel margin:10.f]; [strongSelf.phoneNumberTextField autoPinLeadingToTrailingOfView:phoneNumberLabel margin:10.f];
[self.phoneNumberTextField autoPinTrailingToSuperView]; [strongSelf.phoneNumberTextField autoPinTrailingToSuperView];
[self.phoneNumberTextField autoVCenterInSuperview]; [strongSelf.phoneNumberTextField autoVCenterInSuperview];
// Example row. // Example row.
UIView *examplePhoneNumberRow = [self createRowWithHeight:examplePhoneNumberRowHeight UIView *examplePhoneNumberRow = [strongSelf createRowWithHeight:examplePhoneNumberRowHeight
previousRow:phoneNumberRow previousRow:phoneNumberRow
superview:cell.contentView]; superview:cell.contentView];
[examplePhoneNumberRow addSubview:self.examplePhoneNumberLabel]; [examplePhoneNumberRow addSubview:strongSelf.examplePhoneNumberLabel];
[self.examplePhoneNumberLabel autoVCenterInSuperview]; [strongSelf.examplePhoneNumberLabel autoVCenterInSuperview];
[self.examplePhoneNumberLabel autoPinTrailingToSuperView]; [strongSelf.examplePhoneNumberLabel autoPinTrailingToSuperView];
// Phone Number Button Row // Phone Number Button Row
UIView *buttonRow = UIView *buttonRow = [strongSelf createRowWithHeight:kButtonRowHeight
[self createRowWithHeight:kButtonRowHeight previousRow:examplePhoneNumberRow superview:cell.contentView]; previousRow:examplePhoneNumberRow
[buttonRow addSubview:self.phoneNumberButton]; superview:cell.contentView];
[self.phoneNumberButton autoVCenterInSuperview]; [buttonRow addSubview:strongSelf.phoneNumberButton];
[self.phoneNumberButton autoPinTrailingToSuperView]; [strongSelf.phoneNumberButton autoVCenterInSuperview];
[strongSelf.phoneNumberButton autoPinTrailingToSuperView];
[buttonRow autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [buttonRow autoPinEdgeToSuperviewEdge:ALEdgeBottom];
@ -538,7 +539,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
for (SignalAccount *signalAccount in signalAccounts) { for (SignalAccount *signalAccount in signalAccounts) {
[contactsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [contactsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectRecipientViewController *strongSelf = weakSelf; SelectRecipientViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId]; BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];

View File

@ -136,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN
for (TSThread *thread in [self filteredThreadsWithSearchText]) { for (TSThread *thread in [self filteredThreadsWithSearchText]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectThreadViewController *strongSelf = weakSelf; SelectThreadViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
// To be consistent with the threads (above), we use ContactTableViewCell // To be consistent with the threads (above), we use ContactTableViewCell
// instead of InboxTableViewCell to present contacts and threads. // instead of InboxTableViewCell to present contacts and threads.
@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN
for (SignalAccount *signalAccount in filteredSignalAccounts) { for (SignalAccount *signalAccount in filteredSignalAccounts) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectThreadViewController *strongSelf = weakSelf; SelectThreadViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId]; BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];

View File

@ -239,8 +239,6 @@
- (void)showPrivacy - (void)showPrivacy
{ {
PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init]; PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
@ -260,16 +258,12 @@
- (void)showAdvanced - (void)showAdvanced
{ {
AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init]; AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Advanced Settings View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
- (void)showAbout - (void)showAbout
{ {
AboutTableViewController *vc = [[AboutTableViewController alloc] init]; AboutTableViewController *vc = [[AboutTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"About View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }

View File

@ -169,7 +169,7 @@ NS_ASSUME_NONNULL_BEGIN
for (NSString *recipientId in [recipientIds sortedArrayUsingSelector:@selector(compare:)]) { for (NSString *recipientId in [recipientIds sortedArrayUsingSelector:@selector(compare:)]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
ShowGroupMembersViewController *strongSelf = weakSelf; ShowGroupMembersViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [helper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [helper signalAccountForRecipientId:recipientId];

View File

@ -265,7 +265,7 @@ NS_ASSUME_NONNULL_BEGIN
[section [section
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
UpdateGroupViewController *strongSelf = weakSelf; UpdateGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId];