• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSView events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView events


  • Subject: Re: NSView events
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 5 May 2003 22:50:16 -0700

On Monday, May 5, 2003, at 07:54 PM, Greg Hamilton wrote:

I have a subclass of NSView displayed in a CustomView. It displays correctly but doesn't receive event messages, eg. mouseUp:event
I've done this successfully once before, though this time I'm using a Cocoa Document Based application where my old app was not document based.
Is there some special piece of Project Builder / Interface Builder magic I've missed which will make sure these messages are sent to my view ?

1. Does IB know about the custom view's existence? Make sure you've imported the header file into the nib. IB knows about it if you can browse to the custom view in IB's class browser.

2. If IB knows about it, did you define the view's instance as part of the custom view class? You can see by bringing up IB's info panel (press Cmd-I or choose "Show Info" from the Tools menu). Your subclass should appear in the info panel's title when you click on the view. If it's not there, then you need to choose "Custom Class" (Cmd-5) from the info panel and select the correct subclass. If it doesn't appear _there_, then you've definitely done something wrong. Make sure you subclassed the right object, you instantiated the correct view, and make sure IB knows about it. As a last resort, I suppose you could remove the view instance and replace it with the "custom view" type, then set the custom class using the info panel. But you lose most of the ability to customize the object in IB if you do that.

If the object still doesn't work as expected, then I'm not sure what could be wrong...

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://dreamless.home.attbi.com/

"Great spirits have always encountered violent opposition from mediocre minds." - Albert Einstein
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >NSView events (From: Greg Hamilton <email@hidden>)

  • Prev by Date: Re: Precompiled header woes
  • Next by Date: stringWithUTF8String: Question
  • Previous by thread: NSView events
  • Next by thread: how to use (in a tool) NSServiceBrowser
  • Index(es):
    • Date
    • Thread