Re: Call method from a different file
Re: Call method from a different file
- Subject: Re: Call method from a different file
- From: Andrew Merenbach <email@hidden>
- Date: Wed, 30 Aug 2006 22:03:33 -0700
Hi, Brian. If you want your table view (let's call it myTableView)
to call a method in a different class (call it myOtherClass), I'd
suggest hooking up myTableView's 'delegate' variable to
myOtherClass. This can be done in Interface Builder, or can be done
programmatically via [myTableView setDelegate:myOtherClass].
Then, from your -keyDown: (assume that myOtherClass has a class type
of BAOtherClass): {
[(BAOtherClass *)[self delegate] performMyMethod];
}
Make sure to #import "BAOtherClass.h" into your table view subclass.
Cheers,
Andrew
On Aug 30, 2006, at 1:33 PM, Brian Amerige wrote:
Hi all,
I've got a subclassed NSTableView, and I'm overriding the keyDown
method. However, the method I want to call (when, for example, the
enter key is pressed) is in a different file. (My AppController.m
file). How would I call it from my subclass?
Thanks.
Brian Amerige
http://extendmac.com
http://cocoaforum.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ucla.edu
This email sent to email@hidden
_______________________________________________
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