Re: Returning from an IBAction
Re: Returning from an IBAction
- Subject: Re: Returning from an IBAction
- From: Julio Cesar Silva dos Santos <email@hidden>
- Date: Tue, 28 Mar 2006 13:56:55 -0300
I am just trying to 'do something' only if certain conditions are
met, so I put the code after the check but I could not find out what
IBAction really is (an integer or something like that). Now I know
that IBAction in fact is void so return; solved the problem. Thanks
to Marcus S. Zarra and Stephane Sudre to point it out to me.
Julio Cesar Santos
email@hidden
eMac 1GHz ComboDrive
640MB RAM
Linux User #359973
On 28/03/2006, at 13:25, I. Savant wrote:
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:
This email sent to email@hidden