nscollectionview

How do I get the representedObject from a view in an NSCollectionViewItem?

I have a view that gets used in each of my CollectionView's items. I have an IBOutlet to the CollectionViewItem from my view and I have that hooked up in Interface Builder. I want to access a value from the representedObject (which is a Core Data object) in my view code. Here is an example of what I'm trying to do -- access a sequence...

Simulating a click for NSCollectionView

In an attempt to create drag and drop between two NSCollectionViews in the same app i've made the view that holds the collection views responsible for all the mouse clicks. It then checks what the mouse actually hits, etc. One problem I'm having though, is trying to get the NSCollectionView to handle single clicks properly (i.e. if the s...

How do I bind programatically in the view subclass of my NSCollectionView?

I've successfully created an NSCollectionView and added a label to the view prototype in IB, bound to a property of my represented object. I now want to programatically create an NSButton and NSTextField with the NSTextField bound to a property of my represented object. When the button is clicked I want to show and hide the NSTextField...

How to use NSCollectionView and Outlets properly?

Hey there, I'm desperatley trying to connect controls of NSViews which will reside in a NSCollectionView using outlets. The collection view is feeded using an NSArrayController. I created the NSView in a seperate NIB file and in the implementation of NSCollectionViewItem I overwrote copyWithZone to load it: -(id)copyWithZone:(NSZo...

NSCollectionView not updating subviews on data change

I have set up an NSCollectionView through Interface Builder. My prototype view contains a progress indicator and a text field. I have set up the bindings so that my "task" object maintains the value of the progress indicator and the text field value. It all works okay when I add new objects to the collection (via [NSCollectionView newIt...

Can I hook up an action within an NSCollection view via Interface Builder?

I have an NSCollection view. I want to connect a control in the replicated view either to an outlet my controller, passing in the representedObject, or to an outlet on the representedObject itself. Can I do this with IB or do I need to do this programmatically? ...

How do I implement a customized list in Cocoa?

Hi, I want to build a Cocoa App with a list of entries very similar to the ToDo list of Things.app (see the screencast). The question is whether I should use a TableView, a CollectionView or a WebView. I think it could work with all of them, but which one suits the following requirements best? have a list of entries -> 1 column & ...

Updating NSTableView in an instance of NSCollectionViewItem

In my setup I have an NSCollectionView of volumes connected to the mac. For the NSCollectionViewItem's View I have an NSBox with an NSTableView inside listing the contents of that volume. My problem comes when trying to add/remove items to the NSTableView. The NSBox seems to be initialised once, so there is only one NSTableView. This me...

NSCollectionView in 10.6/Xcode 3.2

Hey there, in Xcode 3.1.2 I used to load the nib of the NSCollectionViewItem in my subclass of NSCollectionViewItem like this: -(id)copyWithZone:(NSZone *)zone { id result = [super copyWithZone:zone]; [NSBundle loadNibNamed:@"PersonView" owner:result]; return result; } In Xcode 3.2 under 10.6 the same method doesn't ...

NSCollectionViewItem double-click action?

How do I set an action for when a user double clicks an NSCollectionViewItem. NSTableView, for example, has the setDoubleAction method. Is there something similar for NSCollectionView? Thanks ...

NSCollectionView draws nothing

I'm trying to set up an NSCollectionView (I have done this successfully in the past, but for some reason it fails this time). I have a model class called "TestModel", and it has an NSString property that just returns a string (just for testing purposes right now). I then have an NSMutableArray property declaration in my main app delegat...

Resize view of NSCollectionViewItem

How do I programatically set the size of a view of an NSCollectionViewItem? I tried doing this in an NSCollectionView subclass: @implementation CustomCollectionView - (NSCollectionViewItem *)newItemForRepresentedObject:(id)object { NSCollectionViewItem *newitem = [[self itemPrototype] copy]; [newitem setRepresentedObject:obje...

Differences between NSTableView and NSCollectionView

I'm trying to decide which path to take for developing my Snow Leopard app. First, I should preface with the obvious differences: NSTableView can have multiple columns of data for representing different parts of the same "element" of data (a row) where NSCollectionView can display a grid of data as well, but every row+column combo is it...

Redrawing NSCollectionView on Scroll Causes Breakup of Graphics

I have a minor irritant in an NSCollectionView in which the NSCollectionViewItem's break up visually when I scroll the window. The rate of breakup depends upon the rate of scrolling. For example, if I scroll slowly the breakup occurs more often. Fast scrolling less so. It appears that the problem is when the custom NSView of the NSColle...

How can I implement a thumbnail-based view for user selection in Cocoa?

Hi, I have what I thought was a pretty simple need but I'm not sure how to go about implementing it. At various points in my interface, the user is asked to make a selection of something rather visual (like choosing a layout for a page or a color option.) These selections are made from a pre-defined set of options. Normally you'd use an...

Cocoa Interface Design Question

The best thing for the window I'm designing would be a table with two rows for each element of an array. I'd have one checkbox and two popups in the first row and the second row would be used for text entry. Based on what I understand of a NSTableView is that's not possible. I looked into a NSCollectionView but I don't have any experi...

CollectionViewItem Selection

I have an NSCollectionView. When I click on one of the actual collection view items it becomes selected. When I click on one of the controls on the view it doesn't. How do I tell the NSCollectionViewItem to set it's selected to YES when, for example, a check box is clicked on it's view? ...

Can NSCollectionView autoresize the width of its subviews to display one column

Hi, I have an NSCollectionView that contains a collection of CustomViews. Initially it tiled the subviews into columns and rows like a grid. I then set the Columns property in IB to 1, so now it just displays them one after another in rows. However, even though my CustomView is 400px wide, it's set to autoresize, the NSCollectionView...

Debugging Nested NSCollectionViews

I'm not really sure how to start debugging this issue. I've got an NSCollectionView, whose NSCollectionViewItem prototype view itself contains an NSCollectionView (as well as an NSArrayController, to provide content to this 2nd-level collection view). Both levels of collection view work fine when the top-level view is in the main nib. ...

Is there a way to have varying views in an NSCollectionView?

I am wanting something similar to how iWork has the template selection screen for Pages when you can select different templates, and each view contains different info has difference sizes etc. I have tried subclassing NSCollectionView and determining which view to display using the newItemForRepresentedObject method (as opposed to using...