Re: creating classes on the fly ??
Re: creating classes on the fly ??
- Subject: Re: creating classes on the fly ??
- From: Daniel Child <email@hidden>
- Date: Thu, 04 Oct 2007 10:13:41 -0400
From your link, I can see that in theory, at least, that class
creation could be done, though it looks very involved. I didn't see
how you would do methods, though. I think for now I will stick to a
prototype with built-in classes, and will consider this issue again
when I am less of a novice.
Thanks for the link.
On Sep 21, 2007, at 5:32 PM, Scott Thompson wrote:
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