Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I do not know why you had no success, but I have a question: Did you register your tableView for <code>NSFilesPromisePboardType</code> ? Otherwise it doesn't work! I will now show a code snippet from one of my apps which is tested and which works:</p> <pre><code>- (BOOL) tableView:(NSTableView *)aTableView acceptDrop:(id &lt;NSDraggingInfo&gt;)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation { NSPasteboard *pboard = [info draggingPasteboard]; NSArray *types = pboard.types; if( [types containsObject:NSFilesPromisePboardType] ){ NSString *destPath = NSTemporaryDirectory(); // or whatever you want NSURL *destURL = [NSURL fileURLWithPath:destPath isDirectory:YES]; NSLog(@"destURL %@", destURL); NSArray *fileNames = [info namesOfPromisedFilesDroppedAtDestination:destURL]; NSLog(@"fileNames %@", fileNames); if( fileNames == nil ) return NO; NSString *resultPath = [destPath stringByAppendingPathComponent:[fileNames objectAtIndex:0]]; NSLog(@"resultPath %@", resultPath); // read the vCard data from here NSString *vCard = [NSString stringWithContentsOfFile:resultPath encoding:NSASCIIStringEncoding error:NULL]; NSLog(@"vCard =\n%@", vCard); return YES; } return NO; } </code></pre> <p>The test output is;</p> <pre><code>destURL file://localhost/var/folders/j2/78r9kp_d08gc52z04w2dwkv80000gn/T/ fileNames ( "Heinrich Giesen 2.vcf" ) resultPath /var/folders/j2/78r9kp_d08gc52z04w2dwkv80000gn/T/Heinrich Giesen 2.vcf vCard = BEGIN:VCAR VERSION:3.0 </code></pre> <p>. . . and so on. ending with</p> <pre><code>END:VCARD </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload