Re: Returning from an IBAction
Re: Returning from an IBAction
- Subject: Re: Returning from an IBAction
- From: "I. Savant" <email@hidden>
- Date: Tue, 28 Mar 2006 11:25:20 -0500
What does the warning tell you? That you're trying to return
something in a method that returns void (IBAction is the same as
void). It sounds like you could use another run through the
introduction topics on Objective-C and Cocoa in general.
What exactly are you trying to accomplish in this method?
--
I.S.
On Mar 28, 2006, at 11:11 AM, Julio Cesar Silva dos Santos wrote:
Hi, I am trying to accomplish a simple task with an IBAction but
apparently it is not clear how can I return from an IBAction. My
action looks like this:
- (IBAction)myAction:(id)sender
{
//Some check
if (some_thing != other_thing)
{
NSAlert * myAlert;
//Create the alert
[myAlert beginSheetForModalWindow:...];
return ???
}
//Other code
}
Well, the 'Other code' should only be called if the check catches
an error so normally I would return nil or something else but then
I receive a warning that "return with a value, in function
returning void". How can this be done?
Thanks for any help,
Julio Cesar Santos
email@hidden
eMac 1GHz ComboDrive
640MB RAM
Linux User #359973
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
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