Re: creating classes on the fly ??
Re: creating classes on the fly ??
- Subject: Re: creating classes on the fly ??
- From: Scott Thompson <email@hidden>
- Date: Fri, 21 Sep 2007 16:32:41 -0500
On Sep 21, 2007, at 4:23 PM, Daniel Child wrote:
*** Is it possible to define the details of a class dynamically?
For example, let's say I use the generic parser to parse lexicon
flat files having different data structures. Is there any way in
Cocoa to create the class and describe the type and number of
instance variables dynamically?
Yes. That's how tools like RubyCocoa and PyObjC can interact with
Objective-C code.
see
http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html
There are two things to note, however. First the mechanism could
change between releases of the OS. In particular, there is evidence
to suggest that it will change somewhat in Leopard (though I suspect
it will become easier to do in Leopard than it is in Tiger).
Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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