Re: run method from other method
Re: run method from other method
- Subject: Re: run method from other method
- From: Kevin Ballard <email@hidden>
- Date: Sat, 15 Jan 2005 16:53:32 -0500
methodA and methodB each take a single argument. When you click the A
and B buttons, this argument is a pointer to the NSButton instance for
each button. Presumably you're not doing anything with this, since
you're also calling these methods from methodC. So methodC should look
like
- (IBAction)methodC:(id)sender
{
// do both methods
[self methodA:nil];
[self methodB:nil];
}
You could also pass self instead of nil, but since you're not using
this argument it really doesn't matter what you pass.
On Jan 15, 2005, at 4:28 PM, Michael Swan wrote:
I am teaching myself, or trying anyway, Cocoa with Obj-C. I follow a
few examples and then try to make something on my own. I have gotten
stuck on my latest project. It has 3 buttons (a, b, & c) and a
different method for each. a does one set of tasks, b a second, and c
does both methods, (... or should anyway). a & b are fine but c is not
working at all. I'm sure its something simple but I don't even know
what to put into the search field (self returns no documents). Below
is a copy of methodC, if anyone has any ideas I'd be grateful to hear
them.
- (IBAction)methodC:(id)sender
{
// do both methods
[self methodA];
[self methodB];
}
- (IBAction)methodA:(id)sender
{
//do some stuff
}
- (IBAction)methodB:(id)sender
{
do some different stuff
}
--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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