Re: sortedArrayUsingFunction:context: why context is of type void?
Re: sortedArrayUsingFunction:context: why context is of type void?
- Subject: Re: sortedArrayUsingFunction:context: why context is of type void?
- From: "b.bum" <email@hidden>
- Date: Sun, 20 Jun 2004 13:43:25 -0700
On Jun 20, 2004, at 1:31 PM, Sherm Pendley wrote:
Use a typecast:
[someObject doSomething: (NSString*)context];
You can also, of course, typecast the recipient of a message:
[(NSString*)context someStringMethod];
Note that (void *) arguments make it a lot harder to do truly dynamic
operations with the runtime. We encountered this in the PyObjC bridge.
There is no way to know if the (void *) points to an object, a struct,
or is just some random meaningful integer. As such, we end up not
being able to support object types in the bridging of that method
without introducing considerable fragility.
Handy, yes, but there is a price for the convenience.
b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.