diff options
Diffstat (limited to 'Drop Serve')
| -rw-r--r-- | Drop Serve/DropZone.m | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Drop Serve/DropZone.m b/Drop Serve/DropZone.m index ac7ccd0..6ae6e49 100644 --- a/Drop Serve/DropZone.m +++ b/Drop Serve/DropZone.m @@ -53,12 +53,19 @@ NSString *file = [files objectAtIndex:0]; BOOL isDirectory = false; - if ([[NSFileManager defaultManager] - fileExistsAtPath:file - isDirectory:&isDirectory] - && isDirectory) { - NSLog(@"%@", file); + if (![[NSFileManager defaultManager] + fileExistsAtPath:file + isDirectory:&isDirectory]) { + NSLog(@"%@ not found", file); } + + NSURL *path = [NSURL fileURLWithPath:file isDirectory:isDirectory]; + + if (!isDirectory) { + path = [path URLByDeletingLastPathComponent]; + } + + NSLog(@"%@", path); } return YES; |
