Questions tagged [nscollectionview]

NSCollectionView is a NSView subclass which provides basic functionality for displaying, arranging, grouping and manipulating graphical representations of collections of objects.

nscollectionview
Filter by
Sorted by
Tagged with
2 votes
1 answer
671 views

OSX Cocoa NSCollectionViewFlowLayout horizontal scroll on zoom / magnification not working

I want to make a zoom-able NSCollectionView in OSX. I use NSCollectionViewFlowLayout with a vertical flow and set allow magnification to true on NSScrollView, it works well. But one thing that I ...
sendy halim's user avatar
0 votes
0 answers
58 views

NSCollectionView Reloads content but not the [sender tag]

i am having a programatically created NSCollectionview _upcomingVideosCollection = [[NSCollectionView alloc] initWithFrame:NSRectFromCGRect(CGRectMake(0, 0, 300, 1200))]; ...
Bonta Alexandru's user avatar
0 votes
1 answer
110 views

textDidChange points to the wrong NSCollectionViewItem

I am trying to build an NSCollectionView filled with multiple editable TextViews. (OS X app in Swift.) My subclass of NSCollectionViewItem is called NoteViewItem. I am trying to have the program ...
Displaced Hoser's user avatar
4 votes
0 answers
308 views

Link NSCollectionView to NSCollectionViewItem in NSStoryboard

In the storyboard, I have an NSCollectionView inside an View Controller Scene, and an Collection View Item Scene. However, I have no idea how to link these two. I can't see anything in Interface ...
Dieter Baron's user avatar
0 votes
1 answer
43 views

Turn multiple values from NSCollectionView into one NSString

This checks my collection view if there is something called "BETA". When this is the case, it should look what the itemID of it is. This should be brought together and return something like "2 4" in a ...
Damian Van de Kauter's user avatar
1 vote
2 answers
940 views

Remove object from NSArray by index

I have a code that removes an object from an NSCollectionView, but it only removes one item. In the NSArray ("array") the value is "2 4" which returns 2, 4. But when I run the code, it only removes "2"...
Damian Van de Kauter's user avatar
6 votes
5 answers
4k views

NSCollectionView custom layout enable scrolling

I can't get scrolling both vertically and horizontally to work with a custom layout for NSCollectionView. According to the docs, in my subclass I return the collectionViewContentSize and if that is ...
DasNilpferd's user avatar
1 vote
3 answers
1k views

How to animate NSCollectionView's scrollToIndexPaths:scrollPosition:?

I'm trying to animate NSCollectionView's scrollToIndexPaths:scrollPosition:, which according to the documentation can be achieved if this message is sent to the collection view's animator proxy. ...
ppilone's user avatar
  • 1,072
1 vote
1 answer
848 views

NSCollectionViewItem has nil outlets in itemForRepresentedObjectAtIndexPath

I have an NSCollectionView that displays a bunch of items that are called "ImageCollectionViewItem"s. I have an ImageCollectionViewItem.xib file that solely has an NSView that covers the item. I want ...
connormurray7's user avatar
4 votes
0 answers
634 views

NSCollectionView does not change background colors when select or deselect 'Use Alternating Colors'

Right now I am working on a Startup Window for my document based application. The window's purpose is to give the user something visual to start with, instead of the menu bar. The window contains a ...
Tom Vos's user avatar
  • 420
2 votes
2 answers
572 views

NSCollectionView Grid of Files Displayed with Icons from Finder's Preview

I am having trouble trying to create an NSCollectionView with icons that are taken from Finder's icon preview. Ideally, if the file is a dmg it should display the hard drive icon, an mp3 should be ...
connormurray7's user avatar
1 vote
1 answer
1k views

NSCollectionView's collectionView:itemForRepresentedObjectAtIndexPath: method is never called

I'm accustomed to iOS's UICollectionView and am trying to set up an NSCollectionView on OSX without using any storyboards (most tutorials use .xibs, so they're slightly different). The API seems ...
BradB's user avatar
  • 509
0 votes
1 answer
790 views

Setting scroll indicator insets on NSCollectionView

I know UIScrollView has scrollIndicatorInsets, so if I had a UICollectionView I could do something like collectionView.scrollIndicatorInsets = UIEdgeInsetsMake(0,0,0,0); But how can I set the scroll ...
Adam Johns's user avatar
  • 35.9k
2 votes
0 answers
322 views

NSCollectionView only renders first 100 cells

I'm trying to display 256 cells in a NSCollectionView. I'm using Storyboard but the NSCollectionViewItem is in a separate xib. It is registered in the CollectionView at startup. A DataSource object ...
Artem Khatchatourov's user avatar
3 votes
0 answers
352 views

numberOfItemsInSection not sent to datasource

I built a NSCollectionView programmatically in a popover as a part of menubar App for OSX. But when clicking the status item, the numberOfItemsInSection was always sent to a NSButton. I tried to ...
guoleii's user avatar
  • 496
1 vote
1 answer
1k views

Assertion failure when using NSCollectionView

I am currently developing an OS X application with Swift. I am trying to use an NSCollectionView in my main view, and so I have added an NSCollectionView object to my .xib file. I haven't changed ...
Rohan's user avatar
  • 551
5 votes
4 answers
2k views

NSCollectionViewFlowLayout - left alignment

NSCollectionViewFlowLayout produces a layout with items justified on the right margin or, if the container is only wide enough for one item, centres items. I was expecting an alignment option, e.g. on ...
Obliquely's user avatar
  • 7,022
4 votes
2 answers
2k views

Creating NSCollectionView with datasource programmatically

I am trying to create a NSCollectionView programmatically using a NSCollectionViewDataSource. The code is very simple: self.collectionView = [[NSCollectionView alloc] init]; // Add collection view ...
kevinlindkvist's user avatar
3 votes
1 answer
1k views

NSCollectionView with vibrant background

I'm trying to get an NSCollectionView in my application to use a vibrant (semi-blurred transparent) background. I've successfully implemented this for other views by simply adding the view (for ...
Dieudonné's user avatar
0 votes
1 answer
600 views

NSCollectionView Delegate Method on Select Header

The latest update to NSCollectionView allows the delegate to detect the selection of items with - (NSSet<NSIndexPath *>*)collectionView:(NSCollectionView*)collectionView ...
Stuart Barth's user avatar
3 votes
0 answers
357 views

How do you bind the selectionIndexes of an NSArrayController to an NSCollectionView?

I have a storyboard view controller scene the contains an NSArrayController object and an NSCollectionView. The bindings of the collection view look like this: The bindings of the array controller ...
Rik's user avatar
  • 493
12 votes
3 answers
1k views

Extend selection in NSCollectionView with Shift key

I recently reviewed one of my Applications that I released a year ago. And I see that nowadays the NSCollectionView inside it has lost the selection functioning such as SHIFT + Select now it behaving ...
Coldsteel48's user avatar
  • 3,492
11 votes
3 answers
1k views

NSCollectionView doesn't popup context menu?

I've bounded the menu to the NSCollectionView in interface builder. But when I CTRL+click (right click) on it the menu is not showing. I've tried adding some method to the NSCollectionView subclass. ...
aneuryzm's user avatar
  • 64k
0 votes
1 answer
145 views

Selection delegates for NSCollectionView in a AIPanelPlatformWindow

I'm writing a simple Adobe Illustrator plugin. Starting from the EmptyPanel sample I've added an NSCollectionView to the AIPanelPlatformWindow. The CollectionView is setup just as you would normally ( ...
Alex's user avatar
  • 712
3 votes
2 answers
322 views

NSCollectionView (osx 10.11) hangs when running

I've made a subclass of NSCollectionView which conforms to NSCollectionViewDataSource, NSCollectionViewDelegate but it hangs everytime - I only get the spinning beach ball. public class ...
Chris's user avatar
  • 2,747
5 votes
3 answers
3k views

How do I programmatically select an object (and have that object show as selected) in the new NSCollectionView?

I have sucessfully implemented a 10.11 version of NSCollectionView in my Mac app. It displays the 10 items that I want, but I want the first item to be automatically selected when the app starts. I ...
Ferdinand Rios's user avatar
4 votes
0 answers
787 views

NSCollectionView error: Parameter indexPath out of bounds or nil

I've recently been playing around with OSX programming (usually an iOS guy) but I've hit a strange issue with NSCollectionView that I just can't seem to debug. When I change the data that my data ...
Ash's user avatar
  • 9,243
2 votes
2 answers
2k views

Set Header title with NSCollectionView

I'm working with NSCollectionView, the CollectionView has headers. I need to set an specific title for each header. My code: func collectionView(collectionView: NSCollectionView, ...
Geek20's user avatar
  • 703
0 votes
1 answer
3k views

NSCollectionView selection and deselection

I recently got my NSCollectionView worked in the way, that it handles section the right way. I reached this by adding a binding with the Model Key Path "selected". This action hides a blue view, that ...
Tom Kuschka's user avatar
4 votes
2 answers
4k views

NSCollectionView with Header and Footer

I need something like this: But my code do this: func collectionView(collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> ...
Geek20's user avatar
  • 703
0 votes
1 answer
153 views

Using NSCollectionView with CoreData and an NSImageView

I'm trying to setup up a NSCollectionView which is binded to an entity and I'm trying to load an image into an NSImageView out of this entity. I stored the image as a NSData object. I did a little ...
Tom Kuschka's user avatar
0 votes
0 answers
212 views

NSCollectionView with CoreData

I just tried to create my first OSX-Application with swift. For my Project I need a CollectionView which works with CoreData. I build up my App along the lines of this tutorial. The only difference ...
Tom Kuschka's user avatar
1 vote
1 answer
656 views

Optimise scroll speed and memory usage of NSCollectionView full of images

I'm using an NSCollectionView (with a custom NSCollectionViewLayout as its layout) to browse potentially thousands of local (on disk) images. What is the best way of ensuring scrolling stays smooth ...
Rik's user avatar
  • 493
9 votes
1 answer
3k views

Cocoa NSCollectionView not calling dataSource methods

Having a brain fart and cannot figure out why the dataSource methods for NSCollectionView are not being called. All the samples that I'm coming across for NSCollectionView are using bindings. Even ...
gngrwzrd's user avatar
  • 5,952
1 vote
1 answer
3k views

NSCollectionView animated re-layout

I'm creating a simple app for Mac (10.11). I have NSCollectionView, on which one will sort objects. I've added Drag&Drop support, but NSCollectionView does not animate. Instead, it reloads its ...
GRiMe2D's user avatar
  • 664
1 vote
0 answers
248 views

How do I make an NSCollectionView work with a Swift struct?

I have a model object that’s really a struct. I have an array of these and I would like to present this array in a collection view: func collectionView(collectionView: NSCollectionView, ...
zoul's user avatar
  • 103k
4 votes
0 answers
902 views

10.11 NSCollectionView - automatically resize so that no scrolling is required

I'm using a NSCollectionView with OS X 10.11's Flow layout to display a varying amount of content. If there are too many items displayed, the default is to show scroll bars according to the Scroll ...
Etan's user avatar
  • 17.3k
10 votes
1 answer
4k views

10.11 NSCollectionView - determining cell size dynamically

AppKit Release Notes for OS X v10.11 suggests that collection view items can be resized on a per-item basis: Item size can be determined globally for all of a CollectionView’s items (by setting an ...
Etan's user avatar
  • 17.3k
5 votes
1 answer
7k views

10.11 NSCollectionView: "could not load the nibName: NSCollectionViewItem in bundle NSBundle"

I want to use a NSCollectionView with the new API model from Swift according to https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/#10_11CollectionView. Since I prefer doing as much ...
Etan's user avatar
  • 17.3k
0 votes
2 answers
364 views

NSCollectionView finished drop event

I'm working on the app that displays svg icons inside NSCollectionView. I want to implement drag&drop feature to allow users drags svg to Finder or another app. There are I have two questions: 1.)...
user1495803's user avatar
1 vote
1 answer
350 views

How do I use indexOf to get the index of a selected NSCollectionView?

I've seen some examples in Objective-C such as this one, but NSCollectionView.subview uses a property called .indexOfObject which I am assuming has been replaced with .indexOf, but I'm not sure how to ...
Dan Beaulieu's user avatar
  • 19.8k
3 votes
1 answer
818 views

NSCollectionView: Accept Drag Only Between Items, not Over

I have a NSCollectionView implemented and working fine. However, when dragging items around to re-arrange them, I'd like to accept drags only between objects. The current behaviour is that you can ...
sidyll's user avatar
  • 58.5k
0 votes
1 answer
162 views

NSCollectionView does not hide in osx

I used NSCollectionView in my application. In certain condition i want to hide and Unhide the NSCollectionView. But it will not hide the NSCollectionView. I used the following code @IBOutlet weak ...
Rizwan Shaikh's user avatar
1 vote
1 answer
699 views

Unable to load item prototype in NSCollectionView

When executing self.colSoundEffects.itemPrototype = self.storyboard!.instantiateControllerWithIdentifier("SoundEffect_Item") as? NSCollectionViewItem in my Swift application, I receive the following ...
Matt's user avatar
  • 2,652
12 votes
0 answers
421 views

NSCollectionView drag and drop placeholder size

I've managed to get drag and drop working on my NSCollectionView, but there are some issues with the visual appearance and behaviour. The main issue is that the drop zone / placeholder is the wrong ...
Luke Rogers's user avatar
  • 2,388
2 votes
0 answers
317 views

NSCollectionView how to drag to arrange view Items ?

I try to use a NSCollectionView but I want to let user to rearrange any item with drag and drop. but I don't know where i should start. Until now, all I have in mind is to use ...
C-Viorel's user avatar
  • 1,856
-3 votes
1 answer
3k views

how to create NSCollectionView using swift for os x [closed]

I am not able to find out any tutorials for os x. Can someone help me with how to create NSCollectionView using swift for os x.
G Avinash's user avatar
0 votes
1 answer
400 views

How to update NSCollectionViewItem when data model change?

I have a NSArrayController bound to a NSCollectionView. My data model is a class Person. Inside Person is a timer that will change the property age every second. In my NSCollectionViewItem I have a ...
TalkingCode's user avatar
  • 13.5k
0 votes
1 answer
642 views

Data binding / NSArrayController: What is the job of the Object Controller

Every tutorial I read about data binding / NSArrayController told to set the Mode and the Keys in the Object Controller (Attributes Inspector) for the data model class I use. Why do I have to do this? ...
TalkingCode's user avatar
  • 13.5k
4 votes
2 answers
2k views

How to fix this 'Prototype Segue' related with my NSCollectionView (Xcode 7.0 beta)

So I've always wanted to code a program for OSX with Swift that needs a Collection View. As it is for OSX, it doesn't use a UICollectionView but a NSCollectionView (by the way, if you know any ...
Marie Arkan's user avatar

1
3 4
5
6 7
9