Re: Hard Objc-Runtime question: objc_getClassList lies to me...
Re: Hard Objc-Runtime question: objc_getClassList lies to me...
- Subject: Re: Hard Objc-Runtime question: objc_getClassList lies to me...
- From: Dylan Adams <email@hidden>
- Date: Thu, 24 Jul 2003 18:53:32 -0500
Martin H wrote:
I doubt this to be the case. All objc_lookUpClass does is, well, look
up for a class with the given name in the list of registered classes.
It is does not change the list of registered classes at all.
Well.. I thought that too.
My claims of the functionality of objc_lookUpClass is based on reading
the source code for it available as part of the objc4 package from
Darwin. It doesn't change the list of registered classes. Perhaps the
behavior has changed? I only examined the code for 10.2.6.
Are you using Xcode with ZeroLink? If so, that could very well be the cause.
I wrote a test case based on the code you've given (except I used
NSSets instead of NSArrays so I could use set operations to look
through the list rather than trying to vgrep the output of NSLog). I
was not able to reproduce the situtation you've described. My test
case is here:
But then I tried your testcase and get these weird results:
--- snip ---
2003-07-24 23:55:07.900 ObjCRuntimeTest[1505] Before contains <CFSet
0x58f40 [0xa018014c]>{count = 2, capacity = 2, values = (
0 : DATestClass
4 : DAClassLister
)}
2003-07-24 23:55:07.907 ObjCRuntimeTest[1505] After contains <CFSet
0x58f40 [0xa018014c]>{count = 2, capacity = 2, values = (
0 : DATestClass
4 : DAClassLister
)}
ObjCRuntimeTest has exited with status 0.
--- snap ---
Notice that the printf is not in this output.
That is very odd. The only explanation I could see is that stdout is
printing to another stream than NSLog. Maybe try switching the printf to
an NSLog?
dylan
_______________________________________________
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.