views:

41

answers:

1

NSMenuItem -setTarget: Does it retain the target, or should one explicitly retain it?

I've seen conflicting docs on this. I know of retainArguments in NSInvocation, but I'm not sure this applies to NSMenuItem as it doesn't inherit from NSInvocation.

+2  A: 

I don't believe it does. Usually target-action methods and delegate properties don't retain what they're set to, as they don't “own” their target.

Noah Witherspoon
It's a good idea to file an enhancement request by using the link at the bottom of the relevant page. A quick look at the -setTarget: API reference confirmed this is not stated either way, though it should be.
Joshua Nozzi
Did so, thanks.
the979kid