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:15:39 -0600

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:address@hidden
> Sent: Friday, November 15, 2002 9:30 AM
> To:   address@hidden
> 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: address@hidden
> 
> 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
> address@hidden
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep




reply via email to

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