Locksleyu Locksleyu - 1 year ago 105
Objective-C Question

Implementing 'show in finder' button in Objective C

In my application I would like to create a 'show in finder' button. I have been able to figure out how to pop up a finder window of that directory but haven't figured out how to highlight the file like the OS does.

Is this possible?

Answer Source
NSArray *fileURLs = [NSArray arrayWithObjects:fileURL1, /* ... */ nil];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];

stolen from Launch OSX Finder window with specific files selected

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download