• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSWorkspace issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSWorkspace issue
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • Next by Date: Re: NSWorkspace issue
  • Previous by thread: Re: Auto layout and re-sizing subviews.
  • Next by thread: Re: NSWorkspace issue
  • Index(es):
    • Date
    • Thread