See
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list
Hello Angelo,
I think this code might help you:
@protocol BackgroundObjDelegate
@optional
- (void)showText:(NSString*)text;
@end
@interface BackgroundObj : NSObject
{
id _delegate;
}
@property(assign) id delegate
- (void) sayHi;
@end
@implementation BackgroundObj
@synthesize deleg
esday, June 10, 2008 8:11 AM
> To: cocoa-dev@lists.apple.com
> Subject: adding a delegate to a class
>
> Hi,
>
> I have a code like this:
>
> @interface BackgroundObj : NSObject
> {
> Controller *mc;
> }
>
> - (void) sayHi;
>
>
> @imple
Hi,
I have a code like this:
@interface BackgroundObj : NSObject
{
Controller *mc;
}
- (void) sayHi;
@implementation BackgroundObj
- (void) sayHi
{
[mc showText:@"Hi"];
}
@end
As you can see, the code is hard coded to use class Controller, can not be used
with any other obje