Fixed memory leaks

Introduced Sorting
This commit is contained in:
michael starke
2013-05-11 23:56:49 +02:00
parent e33545a1de
commit ca4b8ee946
7 changed files with 71 additions and 5 deletions

View File

@@ -151,6 +151,14 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[passwordColumn setIdentifier:MPEntryTablePasswordColumnIdentifier];
[urlColumn setIdentifier:MPEntryTableURLColumnIdentifier];
NSSortDescriptor *titleColumSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"title" ascending:YES selector:@selector(compare:)];
NSSortDescriptor *userNameSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"username" ascending:YES selector:@selector(compare:)];
NSSortDescriptor *urlSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"url" ascending:YES selector:@selector(compare:)];
[titleColumn setSortDescriptorPrototype:titleColumSortDescriptor];
[userNameColumn setSortDescriptorPrototype:userNameSortDescriptor];
[urlColumn setSortDescriptorPrototype:urlSortDescriptor];
[[parentColumn headerCell] setStringValue:@"Group"];
[[titleColumn headerCell] setStringValue:@"Title"];
[[userNameColumn headerCell] setStringValue:@"Username"];
@@ -158,6 +166,8 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[[urlColumn headerCell] setStringValue:@"URL"];
[self.entryTable bind:NSContentBinding toObject:self.entryArrayController withKeyPath:@"arrangedObjects" options:nil];
[self.entryTable bind:NSSortDescriptorsBinding toObject:self.entryArrayController withKeyPath:@"sortDescriptors" options:nil];
[parentColumn setHidden:YES];
}
#pragma mark NSTableViewDelgate