drawRect not being called by NSCollectionView..
drawRect not being called by NSCollectionView..
- Subject: drawRect not being called by NSCollectionView..
- From: Robert Monaghan <email@hidden>
- Date: Mon, 10 Oct 2011 16:49:24 -0700
Hi Everyone,
I can't seem to get an NSCollectionView to render an of the NSCollectionViewItems' NSViews.
I have an NSCollectionView that is bound to an NSArrayController's arrangedObjects.
The NSCollectionViewItem is set up as a template, and also has its Outlet attached to an NSView.
For fun I added a text label as well as an image from the Media Library, as a placeholder image on the NSView.
(It helps to have something to look at!)
I don't have anything bound to the NSView at all.
I haven't subclassed anything either. These are the standard objects within IB.
My App inserts objects into an array using the NSArrayController as needed.
However, as this happens, *nothing* is rendered at all. As a test, I have subclassed the NSView, and checked the drawRect method.
Nothing.
I enabled selectable in my NSCollectionView and checked for a hitTest method in my view. I can blindly click inside the NSCollectionView to the approximate location of the view, and see an hitTest response. Strange! So I know that my NSView is being recognized by my NSCollectionView, as hitTest is being called. But drawRect isn't happening.
Can anyone hazard a guess at what I am doing wrong?
Some notes..
This interface is to drive a network device. As such, the UI doesn't actually populate with anything until it is discovered over the network.
As a matter of fact, the array that the NSArrayController uses doesn't even exit during the "awakeFromNib" process. The actual array is created as soon as the device comes online, and is attached using a binding. Perhaps I need to send some sort of message to the NSCollectionView after the new array is bound?
Thanks!
bob.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden