Re: document based app, custom ibaction
Re: document based app, custom ibaction
- Subject: Re: document based app, custom ibaction
- From: Graham Cox <email@hidden>
- Date: Tue, 19 Aug 2008 17:31:26 +1000
On 19 Aug 2008, at 5:08 pm, Bart wrote:
I've created a new xcode project, document based cocoa app.
Added this code to the mydocument class:
m:
-(IBAction)getTotals
{
NSLog(@"Hello");
}
h:
-(IBAction)getTotals;
I've created a button in the MyDocument.xib, connected through the
firstresponder to the getTotals method. Everything compiles ok, but
when I push the button nothing happens. Am I missing something
somewhere?
Some help would very much be appreciated!
IBAction methods must be declared like this:
- (IBAction) someActionMethod:(id) sender;
since your method doesn't have the right signature, it's not being
called. Even if you don't need the sender, your method must be
declared as having one.
hth,
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden