Questions tagged [cocoa-bindings]

Cocoa bindings is Apple’s implementation of the Model-View-Controller design pattern for Mac OS X applications. It provides technologies that automate the synchronisation of domain data and the user interface elements that present them.

975 questions
6
votes
0 answers

NSTreeController without Core Data, simplest way to drag reorder?

I have a class Field. Each instance contains an NSMutableArray of subfields, which are more Field objects. For my UI, I'm using an NSTreeController and an NSOutlineView. I'd like to be able to reorder and move the fields around by dragging. I'm not…
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
6
votes
3 answers

Is it necessary to override bind:toObject:withKeyPath:options: in an NSView subclass to implement binding?

I have an NSView subclass which has property which I want to be bindable. I've implemented the following in the subclass: myView.h: @property (readwrite, retain) NSArray *representedObjects; myView.m: @synthesize…
Benedict Cohen
6
votes
3 answers

How do I keep an NSPathControl updated with the path of the selected cell in an NSBrowser

I need to keep an NSPathControl updated with the currently selected path in an NSBrowser, but I'm having trouble figuring out a way of getting notifications when the path has changed from the NSBrowser. The ideal way to do this would just to be to…
Redwood
  • 66,744
  • 41
  • 126
  • 187
6
votes
1 answer

Create view based NSTableView programmatically using Bindings in Swift

I am working through a Cocoa in Swift book and I am stuck in a chapter on Bindings. The book uses nib files but I want to do everything programmatically (since I am joining a team that does not use nibs). The project is to create a view based table…
RookiePro
  • 633
  • 1
  • 9
  • 18
6
votes
1 answer

How do I bind an iTunes style source list to an NSTableView using Core Data?

I have an iTunes style interface in my application: Source list (NSOutlineView) on the left that contains different libraries and playlists with an NSTableView on the right side of the interface displaying information for "Presentations". Similar…
Austin
  • 4,638
  • 7
  • 41
  • 60
6
votes
2 answers

iPhone Core Data: Do Transformable Attributes have to Transform to only Data?

I've been using transformable attributes in core data to transform complex objects like images and colors into raw data. I took this... The idea behind transformable attributes is that you access an attribute as a non-standard type, but …
TechZen
  • 64,370
  • 15
  • 118
  • 145
6
votes
1 answer

Implementing a KVO/Bindings-Compliant Bridge-Pattern in Cocoa

I'm trying to implement a simple object bridge in cocoa where the bridge object acts as a kvo/bindings-compliant drop in for some arbitrary other NSObject instance. Here is my problem (more details in the code below): A bridge object acts as a drop…
flitzwald
  • 20,200
  • 2
  • 32
  • 28
6
votes
2 answers

What is the relationship between NSImageView and NSImageCell?

It seems that if I create an NSImageView in code, there is no way to have the image automatically scale proportionally up if the NSImageView becomes bigger than the image itself. (an odd omission) On the other hand, if I create the NSImageView in…
pizzafilms
  • 3,829
  • 4
  • 24
  • 39
6
votes
3 answers

What is the Cocoa Touch equivalent to NSArrayController?

Been starting to work with Core Data a bit, and while I've figured out how to use it in regular Cocoa applications, it seems it works a bit differently in Cocoa Touch. How do you bind entities to objects such as table cells in Cocoa Touch?
Kaji
  • 2,220
  • 6
  • 30
  • 45
6
votes
1 answer

Implementing parent->child drill down in Cocoa with Core Data bindings that span multiple entities

I'm trying to create a simple interface to my core data model in the style of iTunes Genre browser. I have a model setup with three entities: Genre <-->> Artist <-->> Album. I'd like to simply tie them each to a NSTableView, but it appears as though…
mbauman
  • 30,958
  • 4
  • 88
  • 123
6
votes
4 answers

NSPopupButton in view based NSTableView: getting bindings to work

Problem Description I'm trying to achieve something that should be simple and fairly common: having a bindings populated NSPopupButton inside bindings populated NSTableView. Apple describes this for a cell based table in the their documentation…
Lukas
  • 1,533
  • 16
  • 21
6
votes
4 answers

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…
Austin
  • 4,638
  • 7
  • 41
  • 60
5
votes
0 answers

Cocoa, binding across 'To-Many' relationships

I have a model which is essentially three entities: Manufacturers <---->> Models <---->> Cars The Manufacturer entity has property 'name' The Model entity has property 'name' The Car entity has properties 'registration' and 'milage' I have a table…
Quantum_Oli
  • 267
  • 2
  • 10
5
votes
1 answer

Using predicates on an array controller to filter related objects

I have an application using Core Data and bindings. I want to have an NSSearchField that can search through an NSArrayController bound to an NSTableView. The array controller contains Core Data objects that have a "name" field. I have setup the…
hekevintran
  • 22,822
  • 32
  • 111
  • 180
5
votes
2 answers

Creating a master-detail app using NSTreeController, NSArrayController and Core Data

I'm coming from iOS and trying to build the simplest master-detail OS X app possible but I'm having a hard time transitioning. More specifically, I can't really fathom how I integrate Core Data with an NSTableView using an NSArrayController; The app…
Rits
  • 5,105
  • 4
  • 42
  • 53