discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: "multiple inheritence" / behavior


From: Mondragon, Ian
Subject: RE: "multiple inheritence" / behavior
Date: Fri, 15 Nov 2002 10:44:51 -0600

jeez....lack of sleep.  sorry about this...  you'll need to define the name
of the protocol.

like:

@protocol SecretMethods

-ian

> -----Original Message-----
> From: Mondragon, Ian 
> Sent: Friday, November 15, 2002 10:16 AM
> To:   ml@orange-concept.com; discuss-gnustep@gnu.org
> Subject:      RE: "multiple inheritence" / behavior
> 
> use a @protocol - that's exactly what they're for.  if you want all of
> your
> classes to respond to everyoneDoThis and everyoneDoThat...
> 
> --- SecretMethods.h ---
> 
> @protocol
> 
> - (void)everyoneDoThis;
> - (void)everyoneDoThat;
> 
> @end
> 
> --- end ---
> 
> then in each of your non-related classes, just declare them like so:
> 
> --- WhateverClass.h ---
> 
> @interface WhateverClass <SecretMethods>
> 
> --- end ---
> 
> then implement the methods.
> 
> problem solved.  another hoo-rah for objc.
> 
> - ian mondragon
> 
> > -----Original Message-----
> > From:       Manuel Guesdon [SMTP:ml@orange-concept.com]
> > Sent:       Friday, November 15, 2002 9:30 AM
> > To: discuss-gnustep@gnu.org
> > Subject:    "multiple inheritence" / behavior
> > 
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset="us-ascii"
> > Content-Disposition: INLINE
> > Organization: Orange Concept
> > X-Mailer: Mahogany 0.64 'Sparc', compiled for Linux 2.4.3-12smp i686
> > Reply-To: ml@orange-concept.com
> > 
> > Hi,
> > 
> > I'dl like to have a common set of methods used by different objects but
> > without letting them inherit from the same class
> > and without adding a category to one of the common inherited class.
> > I've seen behavior methods which seems to be what I need but there are
> > warnings in behavior.h.
> > So, is there another method to make this ? If not, is behaviour will be
> > supported for a long time ? Is there any
> > problem if I add methods by this way in classes which don't have exactly
> > the same ivars (or ivars order) if I don't use
> > these ivars directly ?
> > 
> > Thank you .
> > 
> > Manuel
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Discuss-gnustep mailing list
> > Discuss-gnustep@gnu.org
> > http://mail.gnu.org/mailman/listinfo/discuss-gnustep
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep




reply via email to

[Prev in Thread] Current Thread [Next in Thread]