• 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: elegant sheet cascade handling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elegant sheet cascade handling?


  • Subject: Re: elegant sheet cascade handling?
  • From: Ken Victor <email@hidden>
  • Date: Tue, 10 Apr 2007 10:59:54 -0700

matt,
what i usually do in a situation like this is something like:

int currentState = 0;
for (int currentState = 0; currentState < maxState; currentState++ )
{
	switch (currentState)
	{
		case 0:
			...
			break;
		case 1:
			...
			break;
	}
}

i'll leave it as an "exercise for the reader" to apply to your specific situation (eg, current state could be a file/method static).

hth,
ken


At 10:24 AM -0700 4/10/07, Matt Neuburg <email@hidden> wrote:
Date: Tue, 10 Apr 2007 09:19:51 -0700
From: Matt Neuburg <email@hidden>
Subject: elegant sheet cascade handling?
To: <email@hidden>
Message-ID: <C2410737.1FB72%email@hidden>
Content-Type: text/plain;	charset="US-ASCII"

Has anyone come up with an elegant, maintainable, legible way to express a
logical process that is periodically interspersed with sheets shown to the
user?

Right now, I've got a logical process that is periodically interspersed with
*modal alerts*, so it's all in one method. I'd like to change these modal
alerts to sheets, but of course this means it can't so simply be all in one
method, because as soon as you show a sheet you have to fall out of the
current method. (That is why I started by developing the app usign modal
alerts.)

I don't really want to explode my logic, which is currently very neatly
expressed in a single method, by spreading it over a dozen different methods
with a complicated, illegible, unmaintainable, implicit relationship to one
another, that I'd be scared to modify as I continue to modify my app's
behavior. I guess what I'd really like to do is keep reentering the very
same method and somehow use an expression of state to skip past the part of
the process we've already passed through. However, I'm open to other
suggestions.

(Yes, I could make these sheets application-modal, but I have religious
objections to doing that.)

Just to clarify, here is a schema (with all the details left out) of the
start of my method as it stands right now (it is actually much longer):

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: Access Core Data from Multiple Apps?
  • Next by Date: Run loops and timers
  • Previous by thread: Re: elegant sheet cascade handling?
  • Next by thread: Stateful, "Stickies" like behavior for a document-based app
  • Index(es):
    • Date
    • Thread