• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Variables: Why one way and not another?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Variables: Why one way and not another?
      • From: Robert Borsuk <email@hidden>
References: 
 >Re: Variables: Why one way and not another? (From: "Alastair J.Houghton" <email@hidden>)
 >Re: Variables: Why one way and not another? (From: Robert Borsuk <email@hidden>)

  • Prev by Date: Re: NSArrayController help
  • Next by Date: Re: Variables: Why one way and not another?
  • Previous by thread: Re: Variables: Why one way and not another?
  • Next by thread: Re: Variables: Why one way and not another?
  • Index(es):
    • Date
    • Thread