• 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: Multiple declarations and the ID type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple declarations and the ID type


  • Subject: Re: Multiple declarations and the ID type
  • From: Sherm Pendley <email@hidden>
  • Date: Mon, 21 Jun 2004 21:30:29 -0400

On Jun 21, 2004, at 2:02 PM, Jamie wrote:

Cast to the protocol? I didn't know you could do that. Is that really the only way this can be solved?

Just declare the variable as an id that conforms to MyProtocol, like this:

@interface SomeClass {
id<MyProtocol> someObject;
}
@end

I don't know what Alberto meant by "cast to that before calling the method" - if the variable is correctly declared, there should be no need for a type cast when its methods are called.

sherm--
_______________________________________________
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: 
 >Multiple declarations and the ID type (From: Jamie <email@hidden>)
 >Re: Multiple declarations and the ID type (From: Jamie <email@hidden>)

  • Prev by Date: Re: NSSearchField not calling target
  • Next by Date: Confusing problems with inheritance in Objective-C
  • Previous by thread: Re: Multiple declarations and the ID type
  • Next by thread: Value Transformers and MVC ...
  • Index(es):
    • Date
    • Thread