Re: Basic runtime function usage - objc_getClass
Re: Basic runtime function usage - objc_getClass
- Subject: Re: Basic runtime function usage - objc_getClass
- From: Francis Derive <email@hidden>
- Date: Wed, 23 Nov 2005 22:40:43 +0100
On Nov 23, 2005, at 10:11 PM, Sherm Pendley wrote:
On Nov 23, 2005, at 3:37 PM, Francis Derive wrote:
Oh ma ! Horrible ! it doesn't compile !
Class myPointerToClass = (Class) objc_getClass("MYobject");
if (myPointerToClass) {
NSLog( @"%s", myPointerToClass->name);//KVC.m:32: error:
dereferencing pointer to incomplete type
} else {
NSLog(@"laClasse is NOT registered");
}
Will it be ?
You need to import an additional header:
#import <objc/objc-class.h>
Class is defined as "typedef struct objc_class* Class" in objc/
objc.h, which is (eventually) included from Cocoa.h. But, the
members in struct objc_class are actually defined in objc/objc-
class.h - which is *not* included by default. :-(
sherm--
It had to be ! But what a pain ! I feel confused for the
embarrassment to the extreme edge.
Merci beaucoup,
Francis.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden