Re: Practical deleagte question
Re: Practical deleagte question
- Subject: Re: Practical deleagte question
- From: Ondra Cada <email@hidden>
- Date: Mon, 15 Apr 2002 10:19:00 +0200
On Monday, April 15, 2002, at 09:16 , Famille GOUREAU-SUIGNARD wrote:
In my main module/classe/interface I declare this
- (void)awakeFromNib
{
[cnxAfficheurTable setDelegate : clDelegateTableView] ;
NSLog (@"initalisation") ;
}
clDelegateTableView is my home made classe (that I have instanciated) to
be the delegate of a NSTableView I use. it is a subClass of NSObject.
When I compile I get an error message : parse error before "]"
Do I have to create or initialize my instance of clDelegateTableView ?
Generally (for newbies, always) a delegate should be an instance, not a
class. Therefore, yes, you have to create and initialize an instance, and
set *it* to be the delegate. In other words, *before* this is called, you
have to do somewhere (possibly even in awakeFromNib, depends on yours
project structure):
clDelegateTableView=[[CLDelegateTableView alloc] init];
or so. And of course, clDelegateTableView needs to be a local variable, a
global variable, or a property in some accessible scope (lack of which
generated the error).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.