Re: Monitoring class loading
Re: Monitoring class loading
- Subject: Re: Monitoring class loading
- From: John Hörnkvist <email@hidden>
- Date: Mon, 19 Aug 2002 13:34:02 +0200
On Monday, August 19, 2002, at 03:56 AM, Andrew Demkin wrote:
At 9:32 PM 8/18/02, Kyle Moffett wrote:
On Sunday, August 18, 2002, at 07:13 PM, Lance Bland wrote:
hi-
maybe the attached project will help.
-lance
Thanks, I will eventually want to add the capability to load all classes
interfaces at startup, and this will help a lot, but I have a new problem
now. I need to be able to figure out what type is returned by the
function objc_msgSend. It is defined to return an id, but then how do
functions return an arbitrary struct?
Thanks to everyone!!!
Kyle Moffett
The compiler and runtime use a different mechanism for messages that return
structures. Rather than objc_msgSend, they use objc_msgSend_stret.
In order to determine which mechanism to use (or what the actual return
type is), you'd probably have to parse @interface declarations as I don't
think return types are encoded in any runtime structures.
I think it's in the method signature.
struct retval {int i; int j; int k;};
- (struct retval)myMethod
{
}
NSMethodSignature: types={_retval=iii}@: nargs=2 sizeOfParams=160 returnValueLength=12;
Look at /usr/include/objc/objc-class.h.
Regards,
John Hornkvist
_______________________________________________
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.