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

Re: Inheritance question


  • Subject: Re: Inheritance question
  • From: "Daniel Angermeier" <email@hidden>
  • Date: Fri, 17 Aug 2007 15:44:36 +0200

Thanks for all the suggestions on this!

> What are you really trying to do?

I set a custom NSWindow subclass in IB for a window.
I overrode close and orderOut to do some fading out. however, there is
one particular situation where I do not want this behavior.
since calling the actual implementation of NSWindow doesnt seem to
work directly without any hacks, the only way is probably to add a
state variable to the window subclass and set to YES before and to NO
after I want the exceptional behavior
inside orderOut:
(myState == dontFade)
{
    [super orderOut:nil];
}
else
{
    // custom overridden behavior
}

If anyone has a better design for this, I'd be happy to get a suggestion.

Thanks again,

Daniel


On 8/17/07, j o a r <email@hidden> wrote:
>
> On 17 aug 2007, at 12.41, Daniel Angermeier wrote:
>
> > Ok, this would work for that particular case, but what if I have an
> > instance of MyClass and want to call a super method on it.
> > [(MySuperClass *)myClassInstance theMethod];
> > why does this casting approach at compile time not work ?
> > Is there any other way to force the run time to use the super
> > implementation of that method ?
>
>
> What are you really trying to do? Can you describe the problem you're
> trying to solve rather than describing the problems you have with
> your approach to solve that problem?
>
> j o a r
>
>
>
>
_______________________________________________

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: 
 >Re: Inheritance question (From: "Daniel Angermeier" <email@hidden>)
 >Re: Inheritance question (From: j o a r <email@hidden>)

  • Prev by Date: NSViewAnimation on bounds
  • Next by Date: Re: Inheritance question
  • Previous by thread: Re: Inheritance question
  • Next by thread: Re: Inheritance question
  • Index(es):
    • Date
    • Thread