From b40909e459ec467a82ff0c51a1b5ac56889a298b Mon Sep 17 00:00:00 2001 From: michael starke Date: Fri, 8 Sep 2017 11:43:03 +0200 Subject: [PATCH] using modern Obj-C --- MacPass/MPAttachmentTableDataSource.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MacPass/MPAttachmentTableDataSource.m b/MacPass/MPAttachmentTableDataSource.m index 56df38c0..a16fb9f1 100644 --- a/MacPass/MPAttachmentTableDataSource.m +++ b/MacPass/MPAttachmentTableDataSource.m @@ -27,11 +27,10 @@ - (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation { NSPasteboard *draggingPasteBoard = [info draggingPasteboard]; - NSArray *classArray = [NSArray arrayWithObject:[NSURL class]]; - NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:classArray options:nil]; + NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil]; NSUInteger numberOfDirectories = 0; for(NSURL *url in arrayOfURLs) { - if([url isFileURL] || [url isFileReferenceURL]) { + if(url.fileURL || url.fileReferenceURL) { NSError *error = nil; NSDictionary *resourceKeys = [url resourceValuesForKeys:@[NSURLIsDirectoryKey] error:&error]; if( [resourceKeys[ NSURLIsDirectoryKey ] boolValue] == YES ) { @@ -41,7 +40,7 @@ } return NSDragOperationNone; } - if(numberOfDirectories == [arrayOfURLs count]) { + if(numberOfDirectories == arrayOfURLs.count) { return NSDragOperationNone; } return NSDragOperationCopy;