File's owner as target of button-action

  • I have a nib-file with the File's Owner class set to my own subclass of
    NSViewController. The nib-file also contains a custom view with a button whose
    target and action is set to a method in File's Owner.

    The trouble is that I get EXC_BAD_ACCESS when I click the button and it tries
    to call my action method.

    I guess I have misunderstood something here. Is there something special about
    File's Owner that prevents this from working?

    Regards,

    Andreas
  • On Oct 7, 2008, at 2:34 PM, Andreas Eriksson wrote:

    > I guess I have misunderstood something here. Is there something
    > special about
    > File's Owner that prevents this from working?

      There's not enough information here to answer your question. You
    should post:

    1 - How you instantiate your custom NSViewController class and load
    the nib.
    2 - The code listing for the method in question.
    3 - Where, exactly, the EXC_BAD_ACCESS is encountered.

    --
    I.S.
  • >> I guess I have misunderstood something here. Is there something special
    >> about
    >> File's Owner that prevents this from working?
    >
    > There's not enough information here to answer your question. You should
    > post:
    >
    > 1 - How you instantiate your custom NSViewController class and load the nib.
    > 2 - The code listing for the method in question.
    > 3 - Where, exactly, the EXC_BAD_ACCESS is encountered.

    My bad. I had managed to release the NSViewController (File's Owner). Thanks!

    Regards

    Andreas