Beginner NSAlert question
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