• 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
Re: NSWorkspace openFile: bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWorkspace openFile: bug?


  • Subject: Re: NSWorkspace openFile: bug?
  • From: John Stiles <email@hidden>
  • Date: Fri, 5 Jan 2007 11:03:49 -0800

Is it possible that it is failing in one iteration of your loop— generating the error—and then succeeding in another iteration— generating "Found Growl"?
If that isn't the case, and there's a genuine bug, then I'd recommend using Launch Services directly.



On Jan 5, 2007, at 10:51 AM, Paul Borokhov wrote:

Hello,
It seems that I've run into a bit of an openFile: bug. Using this code:


NSArray *paths = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSAllDomainsMask, YES);
int i = 0;
for (i; i<[paths count]; i++) { // 4 domains possible...there needs to be a better way of doing this
if ([[NSWorkspace sharedWorkspace] openFile:[[paths objectAtIndex:i] stringByAppendingPathComponent:@"PreferencePanes/ Growl.prefPane"]]) {
NSLog(@"Found Growl");
i++;
break;
}
}


I still get "Found Growl" printed in the Console EVEN WHEN the open operation fails. For example, if the pref pane is not to be found in the user's home, the following gets printed in the Console:
2007-01-05 10:41:31.616 : LSOpenFromURLSpec() returned -43 for application (null) path /Users/paulb/Library/PreferencePanes/ Growl.prefPane.
2007-01-05 10:41:31.770 : Found Growl
This is obviously wrong, since the docs state that this method is supposed to return YES if the file was successfully opened; otherwise, NO. Am I missing something here, or is this really not working as documented?
Paul
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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:
40blizzard.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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 openFile: bug?
      • From: Paul Borokhov <email@hidden>
References: 
 >NSWorkspace openFile: bug? (From: Paul Borokhov <email@hidden>)

  • Prev by Date: NSWorkspace openFile: bug?
  • Next by Date: Re: NSWorkspace openFile: bug?
  • Previous by thread: NSWorkspace openFile: bug?
  • Next by thread: Re: NSWorkspace openFile: bug?
  • Index(es):
    • Date
    • Thread