Re: Variables: Why one way and not another?
Re: Variables: Why one way and not another?
- Subject: Re: Variables: Why one way and not another?
- From: Andreas Mayer <email@hidden>
- Date: Sat, 1 Nov 2003 17:07:12 +0100
Am 01.11.2003 um 16:34 schrieb Robert Borsuk:
In my program I route everything through the myview.m subclass. What
I mean by that is that I put a button on the window and join to an
action contained in the myview subclass.
You can't bind an action to a class. You bind actions to instances of
classes.
So which instance does your button send the myButtonPress: message to?
I suspect you created two different instances. The one which is drawn
and another one which is target of the button press message. Put some
NSLog calls in your methods to see what objects/instances are involved:
- (void)drawRect:(NSRect)rect
{
NSLog(@"drawRect: %@", self)
...
}
-(IBAction)myButtonPress:(id)sender
{
NSLog(@"myButtonPress: %@", self)
...
}
bye. Andreas.
_______________________________________________
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.