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!

Op 18 aug 2008, om 19:32 heeft Bart Beulen het volgende geschreven:

I've connected a simple button to the First Responder. I was able to select the action that I've created in my MyDocument class. When I run the program and press the button nothing happens. The function was only containing an NSLog statement to check if it worked. Am I missing anything?

Op 18 aug 2008, om 19:12 heeft Sherm Pendley het volgende geschreven:

On Mon, Aug 18, 2008 at 9:52 AM, Bart Beulen <[EMAIL PROTECTED]> wrote:

However I would like to add a button in my document which is connected to some code, to process the data in the array (etc count up data in columns). I was trying to do this by adding an IBAction function to the MyDocument.h en MyDocument.m files. The problem is that I do not know how to connect the button from my GUI to this action (normally I can ctrl-drag from the button to the object, but I guess this works different for document based apps?

Connect it to the First Responder icon in IB. That will route the
action message through the responder chain, one element of which is
the currently-active document.

Details:

<http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_6.html >

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/b2xtreme%40me.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to