Re: Accessing self in a C static function within an implementation definition
Re: Accessing self in a C static function within an implementation definition
- Subject: Re: Accessing self in a C static function within an implementation definition
- From: Uli Kusterer <email@hidden>
- Date: Mon, 07 Apr 2014 18:41:52 +0200
On 07 Apr 2014, at 12:00, email@hidden wrote:
> In every case the dispatch macro targets the surrounding class.
> So I would like to reduce the call site invocation to:
>
> static void managedEvent_ItemAdded(MonoObject* monoSender, MonoObject* monoEventArgs)
> {
> DBDispatchMonoEvent(@"eventSender:itemAdded:”);
> }
>
> Can I do this?
> Is there a macro in the vein of __FILE__, __FUNCTION__ that returns the encompassing class for any statement?
> I have been unable to turn anything up.
No. If this was a method, you could probably do self.class in your macro, but functions aren't actually class members when they are in an @implementation block. The only special thing they can do is access instance variables of an object of that type.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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