using properties

This commit is contained in:
Michael Starke
2019-01-15 23:54:03 +01:00
parent d022fa2500
commit 9261a9b7f0
2 changed files with 5 additions and 6 deletions

View File

@@ -45,7 +45,7 @@
NSTableCellView *view;
if([selectedIndexes containsIndex:row]) {
MPSelectedAttachmentTableCellView *cellView = [tableView makeViewWithIdentifier:@"SelectedCell" owner:tableView];
[cellView.actionButton setMenu:[self allocateActionMenu]];
cellView.actionButton.menu = [self allocateActionMenu];
view = cellView;
}
else {

View File

@@ -200,17 +200,16 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
[self.observer didChangeModelProperty];
}
- (void)removeCustomField:(id)sender {
NSUInteger index = [sender tag];
NSUInteger viewIndex = [self.customFieldsTableView rowForView:sender];
NSLog(@"index:%ld viewIndex:%ld", index, viewIndex);
KPKAttribute *attribute = self.representedEntry.customAttributes[index];
NSInteger rowIndex = [self.customFieldsTableView rowForView:sender];
NSAssert(rowIndex > 0 && rowIndex < self.representedEntry.customAttributes.count, @"Invalid custom attribute index.");
KPKAttribute *attribute = self.representedEntry.customAttributes[rowIndex];
[self.observer willChangeModelProperty];
[self.representedEntry removeCustomAttribute:attribute];
[self.observer didChangeModelProperty];
}
- (void)saveAttachment:(id)sender {
NSInteger row = [self.attachmentTableView selectedRow];
NSInteger row = self.attachmentTableView.selectedRow;
if(row < 0) {
return; // No selection
}