• 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: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?


  • Subject: Re: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
  • From: Michael Ash <email@hidden>
  • Date: Sun, 15 Mar 2009 11:49:57 -0400

On Sun, Mar 15, 2009 at 10:36 AM, Jerry Krinock <email@hidden> wrote:
> Now, I understand that this design may not look good from the high level --
> for example, what if the user really needed to see that alert.  But has
> anyone ever gotten into trouble by assuming that gui calls "just won't work"
> if NSApp is nil?

I don't know about people who *have* gotten into trouble, but the
*potential* for trouble with this is enormous.

For example, Apple could easily decide in 10.6 (or even 10.5.7) that
NSAlert really could do with an explicit call to NSApplicationLoad for
convenience. Now you are screwed.

Do the right thing, and don't make GUI calls if you don't want GUI stuff.

(Note that if your command-line tool is intended to be used from
anywhere, for example from an ssh session as a different user from the
one logged in to the GUI, then you shouldn't even *link* against
AppKit in the tool, much less call it.)

Mike
_______________________________________________

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: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
      • From: Jerry Krinock <email@hidden>
    • Re: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >GUI Calls in Tool Executable seem to be No-Op. Nice, but safe? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: iPhone UIWebView height?
  • Next by Date: Re: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
  • Previous by thread: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
  • Next by thread: Re: GUI Calls in Tool Executable seem to be No-Op. Nice, but safe?
  • Index(es):
    • Date
    • Thread