• 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: -[Protocol retain] warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[Protocol retain] warning


  • Subject: Re: -[Protocol retain] warning
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Tue, 11 Nov 2003 19:25:28 -0800

Protocol subclasses from Object and thus doesn't respond to -retain. Also, Protocol objects are created by the compiler and cannot be created or destroyed at runtime (well, not in any polite way :)

In this case you could pass an NSValue wrapping a Protocol instead of passing the Protocol itself.

-tim


I have some code that passes a bunch of objects to a thread through an NSArray. One of the objects it passes is a Protocol. In Panther, when I construct the array - which causes a retain message to be sent to each object - I get this warning:

*** -[Protocol retain]: warning: Object compatibility method has been executed at least once. Convert source code off it NOW!

How am I supposed to pass a protocol around?
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >-[Protocol retain] warning (From: Larry Campbell <email@hidden>)

  • Prev by Date: Linking w/SDKs from the command line
  • Next by Date: Cannot reindex, error
  • Previous by thread: -[Protocol retain] warning
  • Next by thread: Re: Types
  • Index(es):
    • Date
    • Thread