Re: NSView subclasses with IB
Re: NSView subclasses with IB
- Subject: Re: NSView subclasses with IB
- From: Stephane <email@hidden>
- Date: Thu, 24 Aug 2006 14:39:32 +0200
On Aug 24, 2006, at 12:54 PM, lisaia wrote:
I'm trying to implement a drag operation with an NSImageView
(dragging images out of it) and for this created:
myImageView (from NSImageView) with cellClass method (which returns
[myImageCell class])
myImageCell (from NSImageCell) with trackMouse method
Everything works fine if I create the view programmatically, but if
I set a view of type myImageView in a window with IB, the
trackMouse method of myImageCell isn't called. In the best case the
cell of myImageView will be of class myImageCell at initialization
time but not afterwards.
(Also put myImageView and myImageCell classes in IB file)
Does anybody know what's happening or where I can find help,
particulary for IB (I followed "Control and Cell Programming Topics
for Cocoa" rules)?
One solution is to implement initWithCoder: in the myImageView class
so that you can replace the cell instance.
Another one is to create your own palette with your myImageView
object so that the nib really contains a myImageCell instance.
Is there a better way to implement dragging?
A category which replaces the appropriate methods?
--
Stephane Sudre
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden