Re: Dynamic Creation
Re: Dynamic Creation
- Subject: Re: Dynamic Creation
- From: Wim Lewis <email@hidden>
- Date: Mon, 18 Feb 2013 12:22:59 -0800
On 18 Feb 2013, at 1:17 AM, Christ Levesque wrote:
> Ability to create instances of classes that did not exist at the time an app was compiled and dynamically load and link new class at runtime.
> How to implement it?
NSBundle is the Cocoa way to deal with loading new code at runtime (plugins, etc). (Or CFBundle if you prefer the CoreFoundation APIs.) You can either use NSBundle's -principalClass or -classNamed: methods to find the newly-loaded class, or you can give the class a +load method and have it register itself with your app somehow when the bundle is loaded. (See the NSObject documentation for information about the +load method.)
_______________________________________________
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