Cocoa Programming L42 - NSCollectionView

AppleProgramming · 20K views · 2012 · 17:50

Open on YouTube

Software (other)Testing, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a step-by-step tutorial when they need to set up NSCollectionView, even though several later say it is outdated or fails on newer Xcode versions.

Recommended by 3 people across 3 different months, 2014 to 2022.

What it is

A 17-minute screencast from the AppleProgramming channel, part of a Cocoa Programming series, showing how to use NSCollectionView in an Objective-C macOS app. It builds a collection view in Interface Builder and drives it with an array controller and bindings.

What people said

Recommends insys · 2014-02 · Stack Overflow · on “Writing a class that creates multiple interface objects in Cocoa”

Your case is a bit unclear from you description. It'd be good if you could provide more details and perhaps a screenshot as well. You mention writing a class that and create some instances of it. You should ask yourself though, what is the conceptual importance of that class? In fact, I wouldn't go as far as creating a class for each group, just to position the controls. In this case, a simple method in your controller (or elsewhere) should be enough to instantiate, position and rig your controls up: - (void)placeNewControlGroup { // do the placement // set up bindings // rig actions etc. } Then whenever you need, you can call that method to create a new group of controls (i.e. slider, label

Recommends markhunte · 2014-05 · Stack Overflow · on “How do I draw a grid of images in Cocoa and export it to a PDF?”

Have a look at NSCollectionView [LINK] Overview NSCollectionView class displays an array of content as a grid of views. The views are specified using the NSCollectionViewItem class which makes loadings nibs containing the view easy, and supports bindings There are lots of tutorials. Including: Cocoa Programming L42 - NSCollectionView [this video] And Apples own quick guide to Collection Views [LINK] And maybe also look at NSDocuments [LINK] Overview The NSDocument abstract class defines the interface for OS X documents. A document is an object that can internally represent data displayed in a window and that can read data from and write data to a file or file package. Documents create and manage

Recommends NotationMaster · 2022-05 · Stack Overflow · on “Why is NSCollectionView on macOS 12 with Objective-C on Xcode 13 not working?”

I am following a personal learning path for macOS development, learning the basics of C and Objective-C before moving on to Swift (which I already know a bit, but felt the need to learn where all that came from). I am aware there are better, more modern and functional APIs, so please do not suggest learning that or SwiftUI. The point of this question is knowing what is not working in my example. I closely followed this tutorial [this video] , whose source code can be downloaded from here [LINK] . My code is available here [LINK] , instead. The first thing I noticed while following the tutorial is that Xcode (v 13.3.1 on macOS 12.3.1) doesn't add a Collection View Item and a View to the xib's work

Cites HelloiWorld · 2015-02 · Stack Overflow · on “Why am I getting an error about NSCollectionView not being nil?”

This is my BookListObject.h : @ property (nonatomic,retain)NSImage *bookImage; @ property (nonatomic,copy) NSString *bookName; and I connect these bindings: bookImage ----- representedObject.bookImage bookName ------representedObject.bookName arrayController-------arrangedObject -(void)awakeFromNib{ BookListObject * book=[[BookListObject alloc] init]; book.bookName=@"unknown"; book.bookImage=[NSImage imageNamed:@"dis"]; _bookList=[NSMutableArray arrayWithObjects:book, nil]; [arrayController addObject:_bookList]; } I have seen this video [this video] . When I run my project, it crashes and prompts that NSCollectionView item prototype must not be nil. I found the following method, but it doesn't wo

Cites JaSHin · 2015-03 · Stack Overflow · on “NSCollectionView won't work”

I have a problem with NSCollectionView. According to this manual ( [this video] ), which seems to me is very simple. I created NSCollectionView, NSArrayController which I bind NSMuttableArray * todoList and set Todo class. I joined ViewController with IBAOutlet NSArrayController. Everything seems OK, but when I call [arrayController addobject: todo], it throws an exception. see. pictures. ViewController.h: #import <Cocoa/Cocoa.h> @interface ViewController : NSViewController{ IBOutlet NSArrayController *todoArrayController; } @property NSMutableArray *todoList; @property IBOutlet NSImageView *logo; @end ViewController.m: #import "ViewController.h" #import "Db.h" #import "TodoManager.h" @interface

Cites Ecks · 2015-03 · Stack Overflow · on “Xcode 6 NSCollectionView Bug?”

I am trying to use an NSCollectionView for the first time so I go straight to the Apple Documentation Quick Start for Collection Views [LINK] but it seems to fail every time. My first attempt I converted the code to Swift as I went and thought that it was just a conversion error on my behalf. The second attempt was by using the above tutorial and this great [this video] but still trying to convert to Swift. The third attempt was pure Objective C and following the Apple Quick Start word for word, even copy & pasting all of the code and this still failed. My question here i guess is is there a bug in XCode 6.2 or am I just missing something silly? Is it worth attempting this in code? I am not getti

Cites Rakshit Korat · 2015-10 · Stack Overflow · on “OSX making NSCollectionView in Xcode 6.4 with objective c”

I have looked up a lot of resources for programming NSCollectionView but couldn't find any please help. Seen following but not working: 1. [LINK] 2. not found any relevant source code on github 3.watched- [this video] but outdated. please help.