Skip to content

Commit

Permalink
Warnings removed.
Browse files Browse the repository at this point in the history
Do not change the delegate of an UI object on a secondary thread.
  • Loading branch information
Mento committed Jun 15, 2018
1 parent 348bd8f commit 34559b6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Source/RecipientWindowController.m
Expand Up @@ -135,7 +135,7 @@ - (void)windowDidLoad {
ascending:YES
selector:@selector(localizedCaseInsensitiveCompare:)];
[keyTableView setSortDescriptors:[NSArray arrayWithObject:sd]];
[self tableView:keyTableView sortDescriptorsDidChange:nil];
[self tableView:keyTableView sortDescriptorsDidChange:@[]];

[self generateContextMenuForTable:keyTableView];

Expand All @@ -145,12 +145,17 @@ - (void)windowDidLoad {
}

- (void)dealloc {
keyTableView.delegate = nil;
keyTableView.dataSource = nil;
searchField.delegate = nil;

void (^block)() = ^{
keyTableView.delegate = nil;
keyTableView.dataSource = nil;
searchField.delegate = nil;
};

if ([NSThread isMainThread]) {
block();
} else {
dispatch_sync(dispatch_get_main_queue(), block);
}
}

#pragma mark -
Expand Down Expand Up @@ -297,7 +302,7 @@ - (void)setSortDescriptors:(NSArray *)sortDescriptors {
#pragma mark -
#pragma mark Delegate

- (void)tableView:(NSTableView *)aTableView sortDescriptorsDidChange:(NSArray *)oldDescriptors {
- (void)tableView:(NSTableView *)aTableView sortDescriptorsDidChange:(__unused NSArray *)oldDescriptors {
self.sortDescriptors = [keyTableView sortDescriptors];
}

Expand Down

0 comments on commit 34559b6

Please sign in to comment.