Re: Constructing class names dynamically
Re: Constructing class names dynamically
- Subject: Re: Constructing class names dynamically
- From: "Mohan Parthasarathy" <email@hidden>
- Date: Tue, 13 Jan 2009 13:43:19 -0800
thanks, this is exactly what i was looking for..
thanks
mohan
On Tue, Jan 13, 2009 at 1:41 PM, Bill Bumgarner <email@hidden> wrote:
> On Jan 13, 2009, at 1:33 PM, Jean-Daniel Dupas wrote:
>
>> he is just talking about class name, not class.
>>
>> NSClassFromString() is probably what you're looking for.
>>
>> NSMutableString *clsName = derive class name from the entry.
>>
>> Class cls = NSClassFromString(clsName);
>>
>> id<YouProtocol> instance = [[cls alloc] init];
>>
>
> Hah! Yah -- OK -- my bad...
>
> Yes -- that is generally an OK idea. A little odd for a design pattern,
> but not so odd as to raise any warning flags.
>
> b.bum
>
>
_______________________________________________
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