• 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: document based app, custom ibaction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: document based app, custom ibaction


  • Subject: Re: document based app, custom ibaction
  • From: Bart <email@hidden>
  • Date: Tue, 19 Aug 2008 11:03:38 +0200

Another similar problem.

I would like to add a sheet to the button I've created. Normally I would create an IBOutlet and connect the window for the sheet to it, combined with a code to open:

[NSApp beginSheet:totalsSheet
	   modalForWindow:[NSApp mainWindow]
		modalDelegate:self
	   didEndSelector:NULL
		  contextInfo:NULL];

and close it:

	[NSApp endSheet:totalsSheet];
	[totalsSheet orderOut:sender];

However, is this possible when using a mydocument class, because I cannot find any outlets in the interface builder....
I would also like to create some seperate outlets for displaying some float values from some variables of the mydocument class, this is a similar problems since I don't know where to find the outlets to connect the GUI elements to.


At the moment all data is presented in a table using an array controller. This is fine, but I would like to perform some calculations on the same data and present the results in a pop-up window. I guess the method described above should be a nice way to do this.



Op 19 aug 2008, om 09:50 heeft Bart Beulen het volgende geschreven:

Thanks,

Again sloppy programming.... didn't know this could cause problems although the compiler was not worried. I guess I will not make such an error anymore in the future. :o)

Op 19 aug 2008, om 09:31 heeft Graham Cox het volgende geschreven:


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

_______________________________________________

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


  • Follow-Ups:
    • Re: document based app, custom ibaction
      • From: Graham Cox <email@hidden>
References: 
 >document based app, custom ibaction (From: Bart Beulen <email@hidden>)
 >Re: document based app, custom ibaction (From: "Sherm Pendley" <email@hidden>)
 >Re: document based app, custom ibaction (From: Bart Beulen <email@hidden>)
 >Re: document based app, custom ibaction (From: Bart <email@hidden>)
 >Re: document based app, custom ibaction (From: Graham Cox <email@hidden>)
 >Re: document based app, custom ibaction (From: Bart Beulen <email@hidden>)

  • Prev by Date: Re: Hex representation of NSString
  • Next by Date: Re: IKImageBrowser drag reordering question/problem
  • Previous by thread: Re: document based app, custom ibaction
  • Next by thread: Re: document based app, custom ibaction
  • Index(es):
    • Date
    • Thread