NSWorkspace issue
NSWorkspace issue
- Subject: NSWorkspace issue
- From: Varun Chandramohan <email@hidden>
- Date: Wed, 07 May 2014 05:02:54 +0000
- Thread-topic: NSWorkspace issue
Hi All,
I wanted to open a Finder window from my app with a file pre-selected. The user could perform any Finder operations needed. I looked around the internet and it turns out the best way to do this is using NSWorkspace.
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
NSURL *fileURL = [NSURL URLWithString:@"/Users/usr/Desktop/libd.dylib"];
NSArray *fileURLs = [NSArray arrayWithObjects:fileURL, nil];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
}
However, I am not sure what is going on. The Finder window never pops up. I do see the top bar change to Finder bar but then the window is never present. The file I am trying to highlight is present. Is there anyway to know error code? The method is void.
Regards,
Varun
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden