• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OT: Categories and alloc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: OT: Categories and alloc. (From: Jorge Mederos <email@hidden>)

  • Prev by Date: Re: Drawing text?
  • Next by Date: Re: Non-standard Cocoa RTF Unicode encoding?
  • Previous by thread: Re: OT: Categories and alloc.
  • Next by thread: Re: OT: Categories and alloc.
  • Index(es):
    • Date
    • Thread