Re: NSApp sendAction
Re: NSApp sendAction
- Subject: Re: NSApp sendAction
- From: Andy Lee <email@hidden>
- Date: Wed, 23 Nov 2005 12:32:31 -0500
On Nov 23, 2005, at 12:11 PM, Daniel Jalkut wrote:
if your portNumber is not an NSNumber, you may want to change the
signature of the function so that it expects an NSNumber instead of
a straight int.
To be honest I'm not really sure how dire (if at all) the
consequences of sending a non-object are, but it seems like a bad
idea.
I would agree it's a pretty bad idea, even if you know the argument
you're passing is the same size as an id. If it "happens" to work,
that is an accident of the implementation of -
performSelector:withObject:withObject:. That implementation is
within its rights to send a message to any of its object arguments,
and if it tries that with a non-object your app will crash.
If using an NSNumber is not an option, there is still the
NSInvocation route, which is more complicated but allows for non-
object arguments.
--Andy
_______________________________________________
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