• 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: Launching System Prefs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching System Prefs


  • Subject: Re: Launching System Prefs
  • From: Kodex <email@hidden>
  • Date: Thu, 11 Nov 2004 11:02:59 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

I know im just making a stupid mistake but I get no
errors, no console errors or anything. Here is my
code. Nothing appears to launch, any ideas?

NSString * path;
NSBundle * mainBundle;

mainBundle = [NSBundle mainBundle];

//just using the mac pane for testing right now
path = [mainBundle
pathForResource:@"/System/Library/PreferencePanes/Mac"
ofType:@".prefPane"];

[[NSWorkspace sharedWorkspace] launchApplication:
path];


--- Sean McBride <email@hidden> wrote:

> Kodex (email@hidden) on Thu, Nov 11, 2004
> 12:37 said:
>
> >Im trying to launch the system preferences from
> cocoa
> >and i keep getting a premission denied error. I
> think
> >it has something to do with my path name, im not
> sure
> >how to include spaces in it. Below is my code that
> >fails:
>
> Clark is right that launchApplication: is better.
>
> As for the spaces, you don't need to use any
> backslash or anything, just
> type the path as it is.
>
> However, be aware that hardcoding the path like that
> is not so good,
> when/if Apple moves/renames System Preferences your
> code will break.  It
> would be better to find System Preferences by its
> CFBundleIdentifier or
> CFBundleSignature, which will never change and are
> unique.  You can
> probably do that with Launch Services.
>
>
> --
> Erroneous google translation: "Do not despair! One
> day, we will find of
> the job!"
>
>



__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Launching System Prefs
      • From: Douglas Davidson <email@hidden>
References: 
 >Re: Launching System Prefs (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: CGPostKeyboardEvent strangeness
  • Next by Date: Re: Launching System Prefs
  • Previous by thread: Re: Launching System Prefs
  • Next by thread: Re: Launching System Prefs
  • Index(es):
    • Date
    • Thread