• 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: Specifying a class which conforms to a protocol
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying a class which conforms to a protocol


  • Subject: Re: Specifying a class which conforms to a protocol
  • From: Nathan Day <email@hidden>
  • Date: Tue, 30 Jul 2002 17:00:04 +0930

I think the only way to do this is dynamicly by using +conformsToProtocol:, alternatively you can take a prototype object and then copy it instead, NSMatrix can work like this.

On Monday, July 29, 2002, at 09:20 AM, David Newberry wrote:

In my app, I have a class which I want to create instances of another class. To allow for more freedom though, I don't want to tie it down to creating only one kind of class... the only real requirement is that the class conform to a particular (formal) protocol. I've set it up so that the class to use is passed as a Class variable, but it wont let me specify something like "(Class <myProtocol>)class", which is what I'd like to do. Is there any way to do this?

Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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: 
 >Specifying a class which conforms to a protocol (From: David Newberry <email@hidden>)

  • Prev by Date: Re: More efficient solution than DO?
  • Next by Date: maximize and new
  • Previous by thread: Specifying a class which conforms to a protocol
  • Next by thread: Re: cocoa-dev digest, Vol 2 #1010 - 13 msgs
  • Index(es):
    • Date
    • Thread