Re: elegant sheet cascade handling?
Re: elegant sheet cascade handling?
- Subject: Re: elegant sheet cascade handling?
- From: Keary Suska <email@hidden>
- Date: Tue, 10 Apr 2007 13:25:01 -0600
- Thread-topic: elegant sheet cascade handling?
on 4/10/07 10:19 AM, email@hidden purportedly said:
> 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.
My personal preference is to have my application logic follow the Cocoa
logic, and in your specific situation, I would have two methods: one that
tests for conditions and raises the sheet, the second that is the
didEndSelector that performs any actions dependent on the sheet result,
using contextInfo to pass any state info.
In the didEndSelector, using "case" and an enum may provide even more
readable and maintainable code. Seems much better than multi-level "if"
statements, which I tend to find less easy to follow.
You are probably already aware that you will need to orderOut: the sheet
window to allow for sheet cascading, but it never hurts to be reminded.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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