NSControl subclass can't read target?

The following code:

- (void) setTarget:(id)anObject {   
    NSLog(@"anObject: %@",anObject);
    [super setTarget:anObject];
    NSLog(@"Target: %@",[self target]);
}

has this conclusion:

anObject: <DropZoneViewController: 0x15dd5770>
Target: (null)

This is a subclass of NSControl. So what am I doing wrong?

What I'm trying to achieve: I have an NScontrol that accepts drag and drop objects. When the drag and drop ends, I want to send a control action to its target. But how do I get a management action and purpose if this does not work?

+5
source share
1 answer

NSControl doesn't save its own goal, this is what its cell should do.

Thus, two reasons are possible:


  • NSActionCell . NSControl , .
    , NSCell, NSControl .

  • NSActionCell. NSCell .
    , NSActionCell, , NSActionCell NSCell. (, NSCell, ), .

+13

All Articles