Re: OT: Categories and alloc.
Re: OT: Categories and alloc.
- Subject: Re: OT: Categories and alloc.
- From: Andrew Pinski <email@hidden>
- Date: Mon, 8 Jul 2002 21:39:47 -0400
On Monday, July 8, 2002, at 09:32 , Jorge Mederos wrote:
This way, to request a new object following the protocol X
without knowing its real class you just need to issue:
id<X> myx = [x newX];
Instead of [x newX] you can do [[[x class]alloc]init] and get
rid of newX.
You can also do [[[bundle principalClass]alloc]init] to get the first x.
Read about NSBundle and about Objective-C features for the Class Class.
Thanks,
Andrew Pinski
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.