Help: Running a method when image is clicked on!

Discussion in 'Mac Programming' started by ljh2008, Jan 25, 2009.

  1. macrumors newbie

    Joined:
    Oct 29, 2008
    #1
    I'm only really just getting started with xCode and interface builder, Im really enjoying it but please can somebody help me with this issue?

    In Interface Builder I have created a image well which has a NSImage inside.
    When the image is clicked on, i want a method to run.
    I have created a method:
    - (IBAction)mouseClick: (id)sender;

    I set that this method as a 'sent action' of the image well just like I would with a button. Although unlike a button the method does not run when the image is clicked on.

    what do I need to do to make it behave in the same way. I have looked thru all the documentation and google searches for hours but cannot figure this out.

    Please can someone point me in the right direction
     
  2. macrumors regular

    hiddenpremise

    Joined:
    Jul 25, 2008
    Location:
    Somewhere between my imagination and reality
    #2
    Did you connect the NSImageView or the NSImageCell that is inside the well to the IBAction? That might be part of the problem.
     
  3. thread starter macrumors newbie

    Joined:
    Oct 29, 2008
    #3
    When i connect either the Image cell or Image Well to my object the connection appears as a 'sent action. for both ImageCell and ImageWell.

    Which should it be?, and why wont it call the method? The method is called of i connect it to a button.

    Thanks
     

Share This Page