• 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: delegation strategy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delegation strategy


  • Subject: Re: delegation strategy
  • From: "Wesley Smith" <email@hidden>
  • Date: Fri, 11 Jul 2008 01:37:47 -0400

Hi Michael,
Thanks for the suggestion.  I think you're right.  I'll give it a shot.
best,
wes

On Thu, Jul 10, 2008 at 11:32 PM, Michael Ash <email@hidden> wrote:
> On Wed, Jul 9, 2008 at 11:19 AM, Wesley Smith <email@hidden> wrote:
>> Hi list,
>> I'm trying to provide a particular windowing interface that combines
>> NSWindow and NSPanel.  For the most part I'm using a custom subclass
>> of NSWindow that adds a decent amount of functionality.  Occasionally,
>> I want to make use of NSPanel (for the NSUtilityWindowMask style flag)
>> and I'd like it to behave exactly as my custom NSWindow subclass does.
>>  I'm sure there's a way to make this work via some form of
>> delegation/message passing so that I don't have to duplicate code and
>> can just have messages passed from the NSWindow and NSPanel objects to
>> my custom methods, but I'm not really sure how that kind of design
>> pattern plays out in Cocoa.  Any ideas? suggestions?
>
> Are you sure you really need an NSWindow subclass? It's pretty
> unusual, and when it is needed it's often for minor things like
> getting nib-archived windows to use a style mask that IB doesn't let
> you choose.
>
> If you can move your behaviors into a controller class, then it will
> be easy to make that controller class work with either an NSWindow or
> an NSPanel. Whether this is possible or easy will depend on exactly
> what you're doing, of course, but generally that's where this kind of
> thing belongs anyway.
>
> Mike
> _______________________________________________
>
> 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
>
_______________________________________________

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: 
 >delegation strategy (From: "Wesley Smith" <email@hidden>)
 >Re: delegation strategy (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Quick look preview multipage rich text
  • Next by Date: any other type of value for the "fromValue" property of CAAnimation?
  • Previous by thread: Re: delegation strategy
  • Next by thread: KVO: Observing an aggregate property of a collection?
  • Index(es):
    • Date
    • Thread