Re: [Newbie question] Subclassing NSButton
Re: [Newbie question] Subclassing NSButton
- Subject: Re: [Newbie question] Subclassing NSButton
- From: "JECKER Frédéric" <email@hidden>
- Date: Mon, 7 Aug 2006 08:17:49 +0200
Hi,
Log messages are appearing and this works well.
The setContext method is called from my window controller in the "init"
method
When the controller is initialized, i call the setContext of each
HoverNSButton to pass
the NSTextField (textfield) and the text to display (text) using this
method.
text and textfield are ivar of HoverNSButton and are used in the
MouseEntered and MouseExited
events to display text's value in textfield (using setStringValue)
Now, when i debug the whole thing it's like the setContent method call from
my controller is just skipped
Fred
On 8/7/06, Matt Neuburg <email@hidden> wrote:
On Sun, 6 Aug 2006 20:52:11 +0200, " JECKER Fr?d?ric " <
email@hidden>
said:
[snip irrelevant stuff]
>adding the following method to my HoverNSButton class:
>- (void) setContext:(NSString*)content container:(NSTextField*)field{
> NSLog(@"Setting Context");
> NSLog(content);
> text=content;
> NSLog(text);
> textfield=field;
>}
>
>I call this method for each button in my controller but this don't work.
>I tried to debug the whole thing but the debugger doesn't enter the
>setContext method.
What does "don't work" mean? Are the log messages appearing?
(a) If not, clearly you are *not* calling this method, and the question
would then be how you are forming those calls and who you're sending them
to.
(b) If the log messages are appearing, then it would be necessary to
explain
what you think should happen, that "text" and "textfield" are, and so on.
Incidentally, if "text" is an ivar, you probably will have memory
management
problems here (i.e. you aren't doing any, which since "content" is an
NSString is surely a mistake that could bite you one way or another). m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden