• 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: Arc and performSelector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arc and performSelector


  • Subject: Re: Arc and performSelector
  • From: David Duncan <email@hidden>
  • Date: Mon, 17 Oct 2011 10:26:40 -0700

On Oct 17, 2011, at 10:19 AM, Gerriet M. Denkmann wrote:

> I understand this. So I tried to tell the compiler that the passed selector is not like copy:
>
> - (void)replaceIn: thing  readSelector: (__attribute__((ns_returns_not_retained)) SEL)selectorIn
> {
> 	NSString *key = [ thing performSelector: selectorIn ];
> }
>
> But it still complains:  "PerformSelector may cause a leak because its selector is unknown".
> Sure, it is unknown, but it's non-retaining behaviour is known.

The attribute you added is not applicable here, so it is ignored (the attribute must be added to a function or method declaration, where as a SEL is just a data type). Consider also that you can't declare such a thing universally for all SEL – it is the underlying method on a particular class that has the behavior you are looking for.

> Is this a bug?

No, its the compiler admitting that it has no way to verify that what is happening will have the behavior you expect. Thats why this is a warning and not an error.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Arc and performSelector (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Arc and performSelector (From: David Duncan <email@hidden>)
 >Re: Arc and performSelector (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Zooming a view, that is contained in an NSScrollView
  • Next by Date: Re: Is it possible to use Radio Group(NSMatrix) in a different way?
  • Previous by thread: Re: Arc and performSelector
  • Next by thread: Re: Arc and performSelector
  • Index(es):
    • Date
    • Thread