• 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: Beginner NSAlert question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginner NSAlert question


  • Subject: Re: Beginner NSAlert question
  • From: Keary Suska <email@hidden>
  • Date: Tue, 06 Nov 2007 10:25:11 -0600
  • Thread-topic: Beginner NSAlert question

on 11/6/07 10:29 AM, email@hidden purportedly said:

> In the middle of this -complete code, an alert might be required. Do
> I put the alert code in the orderStep class, or in the controller
> class?

This may be a gray area of MVC, but I don't see a problem assuming that the
NSAlert class is the controller class in this situation, and the model is
simply asking the controller to prompt for information.

> And is it common for people to use a single didEndSelector for
> several alerts?

Yes, or at least, it is not uncommon. That's one of the reasons for
contextInfo.

> In my pre-Cocoa life, it was my nature to put something like an alert
> asking a simple yes or no question inline in the code that needs the
> answer so having to decide where to put this code is a puzzle for me.
> I'd rather not have a separate didEndSelector at all.

didEndSelector  does not have to do with where your code is, it has to do
with the nature of modal sheets. Because the sheet starts an event loop, you
need a callback method to return control to the caller. This is likely the
main issue you are looking at, if you are confronted with the need to put up
a sheet in the middle of a method.

You can use a modal alert window instead of a sheet, which does what you may
want, but watch out for HIG (Human Interface Guidelines). Otherwise you may
have to segment the method call, regardless of "where" you put the method.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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: Beginner NSAlert question
      • From: Uli Kusterer <email@hidden>
    • Re: Beginner NSAlert question
      • From: David Spooner <email@hidden>
    • Re: Beginner NSAlert question
      • From: Paul Bruneau <email@hidden>
References: 
 >Beginner NSAlert question (From: Paul Bruneau <email@hidden>)

  • Prev by Date: Re: Garbage Collection in 10.4
  • Next by Date: Re: NSImage problem with universal binary
  • Previous by thread: Beginner NSAlert question
  • Next by thread: Re: Beginner NSAlert question
  • Index(es):
    • Date
    • Thread