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
4
votes
1 answer

Pop up Button in view based NSTableView

I'm trying to use a popup button within a view based NSTableView, i would like to populate the values for the popup with the array controller "Sectors". I can get this working fine if the popup is within a regular view, however comes up empty…
Cory
  • 2,302
  • 20
  • 33
4
votes
1 answer

Cocoa Bindings error

Trying to wrap my head around cocoa bindings can't determine the reason for this error I Have a simple app, in which, the app delegate passes the Managedobjectcontext to Window Controller, which passes it to a view controller. The nib associated…
Cory
  • 2,302
  • 20
  • 33
4
votes
1 answer

How do I delete an entity when removing it from an array controller?

I have an entity (e.g. Employee) in a managed object model that is related to two other entities (e.g. Department and Team). Both relationships are one-to-many (i.e. an Employee must have one Department and one Team, Teams and Departments have many…
Matthew
  • 103
  • 4
4
votes
2 answers

NSTextView in NSPersistentDocument doesn't update dirty flag until loses first responder

I have an NSTextView in an NSPersistentDocument window. I bind the text field's contents to a "binary data" Core Data field, but when I type text into the text view, the document's title bar doesn't say "Edited" until the text view loses focus.…
alltom
  • 3,162
  • 4
  • 31
  • 47
4
votes
2 answers

NSTextView textDidChange/didChangeText not called for bindings

I have a custom NSTextView implementation that automatically adjusts the font size so that the text fills the entire view. I overwrote didChangeText to call my font size adjustment method. Works great when the user is editing text, but didChangeText…
Mark
  • 6,647
  • 1
  • 45
  • 88
4
votes
1 answer

NSArrayController selectedIndex changing to 0 after addObject is called

My setup: I'm making a tab-based application using an NSTableView to display tabs and allow users to select tabs. I have an NSTableView bound to an NSArrayController (tableView.content is bound to arrayController.arrangedObjects,…
Chris R
  • 2,875
  • 2
  • 28
  • 29
4
votes
1 answer

Automatic Key-Value Observing in Cocoa

As I learn more about KVO and KVC, I have become curious - How does NSObject provide automatic KVO when accessing setter methods? If I create a new object with an accessor named setName, how does an observer get notified when someon calls [obj…
OptimisticMonkey
  • 538
  • 4
  • 13
4
votes
1 answer

NSPopupButton Bindings with Value Transformer

I don't know if what I see with a popup button populated by bindings with a value transformer is the way it's supposed to be or not -- the unusual thing I'm seeing (at least with respect to what I've seen with value transformers and table views) is…
rdelmar
  • 103,982
  • 12
  • 207
  • 218
4
votes
1 answer

Conditional display pattern in NSTextField's "Value With Pattern" binding

I've got the textfield that shows the count of items in NSArrayController and count of selected items like this: 3 of 5 selected Also I want to show another pattern when there are no selected items, like: 5 items Is there a way to do this only…
Dmitry
  • 7,300
  • 6
  • 32
  • 55
3
votes
1 answer

Checkboxes and View Based Table View

I am having some difficulty trying to use checkboxes as the selectedIndex in a view based table. There is good documentation on view based table here: [View Based Tables ] However, I after searching and looking on Stackoverflow I can't seem to get…
Axwack
  • 569
  • 1
  • 8
  • 26
3
votes
1 answer

What's wrong with my Shared User Defaults Controller binding?

I have created two dictionaries in the user defaults of my application to represent the controls of two players, as such: Player1 = { MoveLeft = 0; MoveRight = 2; MoveDown = 1; , Player2 = { MoveLeft = 40; MoveRight = 41; …
zneak
  • 134,922
  • 42
  • 253
  • 328
3
votes
1 answer

Is it possible to use Cocoa's Bindings to have an editable NSTableView hooked up to an NSMutableArray?

It seems from the bits and pieces I can scrape together that the answer to this one will be "no", so I'll broadly explain what I'm trying to achieve in (the likely) case that I'm trying to hammer in a screw. What I have in my app is a list of valid…
Drarok
  • 3,612
  • 2
  • 31
  • 48
3
votes
4 answers

KVO and Bindings problems using my own (not the shared) NSUserDefaults object

I'm subclassing NSUserDefaults in my application. A side effect of this is I can't use [NSUserDefaults sharedUserDefaults], I have to have a class method to provide my own static defaults object. This isn't been a problem in code, but it's proving…
3
votes
1 answer

Core Data: Sorting results from an abstract entity based on entity type

Is it possible to sort results from Core Data based on the entity type, but: without resorting to adding a fake attribute called something like entityType, and without adversely affecting performance by using KVO/KVC tricks such as introducing…
Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111
3
votes
0 answers

Multiple filtered lists per NSArrayController

What I need to do is simple, Say I have a list of student domain objects @implementation Student : CPObject { CPString name @accessors; BOOL isLate @accessors; BOOL isMale @accessors: } I have a list of these Student objects stored in…