Encoding function pointer in an NSValue
Encoding function pointer in an NSValue
- Subject: Encoding function pointer in an NSValue
- From: Ken Tozier <email@hidden>
- Date: Thu, 24 May 2007 17:06:43 -0400
Hi
I've managed to confuse myself about what exactly I should supply to
NSValue's value:withObjCType: when the value is a function pointer.
Say I define a function pointer typedef like so:
typedef int (*MyObjectComparitor)(id inObject1, id inObject2);
Which of the following is correct?
MyObjectComparitor objComparitor = foo; // some function pointer
NSValue *comparitor = [NSValue value: foo
withObjCType:@encode(MyObjectComparitor)];
NSValue *comparitor = [NSValue value: foo
withObjCType:@encode(MyObjectComparitor *)];
Is it possible to do this sort of thing with a function pointer?
Thanks in advance
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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