• 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: How do people typically implement dialog controllers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do people typically implement dialog controllers?


  • Subject: Re: How do people typically implement dialog controllers?
  • From: Seth Willits <email@hidden>
  • Date: Wed, 10 Sep 2008 20:52:26 -0700

On Sep 10, 2008, at 7:48 PM, Graham Cox wrote:

OK, this is bit of a nebulous question, but I'm curious to know how people are typically implementing controllers for dialog panels.

I follow the NSOpenPanel pattern where the panel is its own controller.


SWSomethingPanel * panel = [SWSomethingPanel myPanel];
[panel setThis:123];
[panel setThat:abc];
[panel beginSheetModalForWindow:windo]
modalDelegate:self didEndSelector:@selector(myPanelDidEnd:returnCode:contextInfo:) contextInfo:info];


....

- (void)myPanelDidEnd:(SWSomethingPanel *)panel returnCode: (NSInteger)returnCode contextInfo:(void *)contextInfo;
{
...
123 = [panel this];
abc = [panel that];
...
}



The panel can handle its settings however it wishes (completely irrelevant to the caller, of course). Mine are all simple enough that bindings don't offer anything extra, so I so far have stuck to just plain old school code. I could save two or three lines if I used bindings in a few places, but eh... who's counting?



-- Seth Willits




_______________________________________________

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


References: 
 >How do people typically implement dialog controllers? (From: Graham Cox <email@hidden>)

  • Prev by Date: How to locate error that occurs while the nib is loading
  • Next by Date: Re: NSTask is Weird
  • Previous by thread: How do people typically implement dialog controllers?
  • Next by thread: Re: How do people typically implement dialog controllers?
  • Index(es):
    • Date
    • Thread