NSMenuItem -setTarget: Does the target save?

NSMenuItem -setTarget: Does it save the target or explicitly save it?

I saw conflicting documents about this. I know that keepArguments is in NSInvocation, but I'm not sure if this applies to NSMenuItem since it does not inherit from NSInvocation.

+3
source share
2 answers

I do not believe that this is so. Typically, target action methods and delegation properties do not preserve what they are configured for, because they do not "own" their goal.

+3
source

Just look at the title:

@property (nullable, weak) id target;

or in Swift:

weak var target: AnyObject? { get set }

, target weak, , . . - , NSMenuItem .

0

Source: https://habr.com/ru/post/1756807/


All Articles