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

Beginner NSAlert question


  • Subject: Beginner NSAlert question
  • From: Paul Bruneau <email@hidden>
  • Date: Tue, 6 Nov 2007 11:29:18 -0500

Hi-

I'm trying to understand the right way to use an NSAlert regarding where it should be handled (MVC) and how many didEndSelector methods I should have.

I have a window where a button allows me to perform a task (called - complete) on the currently-selected orderStep object that appears in a custom view. To perform the task, my view controller (which, right or wrong handles controller tasks for the view and the window) sends a message to the orderStep object, in whose class appears the - complete code.

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? The task definitely "belongs" to that object so my feeling is that the alert is part of that and belongs there. But putting alert code in my model seems wrong.

But as wrong as it seems, it also seems wrong to tie this task into my controller object since this task might need to be performed from any number of other places in my application that have nothing to do with the view or its controller.

And is it common for people to use a single didEndSelector for several alerts? or should I always make a new method for each alert every time?

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.

Thanks for any insights
_______________________________________________

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: Keary Suska <email@hidden>
  • Prev by Date: Re: Extend QuickLook to other standard files
  • Next by Date: Garbage Collection in 10.4
  • Previous by thread: Re: Seeking clarification on NSManagedObjectID
  • Next by thread: Re: Beginner NSAlert question
  • Index(es):
    • Date
    • Thread