Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-04 Thread Keary Suska
s long as you have also implemented robust undo it would be probably be OK for most people. > However - when I uncheck the same thing on the same binding on the > NSTableColumn / NSPopupButtonCell — nothing happens!!! this is mighty weird > for me. You mean it doesn’t disable on mul

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-02 Thread Keary Suska
roller is not agnostic about the values, and the > binding attribute says "Multiple values placeholder” - not multiple Selection > or Object Placeholder. I can’t understand why it won’t work in the other > window. In both places I am not using the contentArrayForMultipleSelection &

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Quincey Morris
ecies of the selected row, or of the selected rows. In that case, you might be able to get the desired functionality by binding “Selected Object” the Measurement Array Controller’s “selection” or “selectedObjects” controller key. > When the content of a popup-button-cell is populated by bindin

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Keary Suska
d each Measurement has length, width, depth, colony-size and > species properties - each bound to one of the NSTableColumns. So far - the > very basic and stranded use of binding. > > Of the Measurement properties - the species - is yet another to-one relation > to the “Species”

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Richard Charles
ted entities. > > Say we have a “WaterSample” entity, and the to-many relation is called > “measurements” and each Measurement has length, width, depth, colony-size and > species properties - each bound to one of the NSTableColumns. So far - the > very basic and stranded use of bi

Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Motti Shneor
NSTableColumns. So far - the very basic and stranded use of binding. Of the Measurement properties - the species - is yet another to-one relation to the “Species” table. To allow the user to edit/change the species of a Measurement (line in the table) I have placed a Popup Button Cell in the

Re: Binding NSTextField to an array

2017-03-06 Thread Quincey Morris
n of some sort, typically modeled as an array. This *can* be set up with a content binding, but it isn’t the only way — it can be a connection instead. The fact that you chose to use a content binding is irrelevant to to everything else that’s going on. The objects vended by the array control

Re: Binding NSTextField to an array

2017-03-06 Thread Jeremy Hughes
er(value: value) } } dynamic var values: [Number] and binding the text field to the “value” field of this wrapper (so the controller key is arrayController.selection and the model key path is “value"). But I wonder if it is possible to bind directly to an array of NSNumbers without using a

Re: Binding NSTextField to an array

2017-03-06 Thread Jeremy Hughes
you > want to bind to “selection.self” instead I believe. > > When binding your array controller to its content, there’s also an option to > have it automatically select all (or something to that effect). You want to > have this turned on too so that the array controller has a sel

Re: Binding NSTextField to an array

2017-03-06 Thread Mike Abdullah
When binding your array controller to its content, there’s also an option to have it automatically select all (or something to that effect). You want to have this turned on too so that the array controller has a selection to generate values from. Mike. > On 6 Mar 2017, at 17:44, Jeremy Hugh

Re: Binding NSTextField to an array

2017-03-06 Thread Jeremy Hughes
> On 6 Mar 2017, at 14:30, Jonathan Mitchell wrote: > > Sounds like NSValueTransformer is in fact what you need. > It can take in your NSArray ref and spit out a single NSString that the > NSTextField binding can live with. I think I must be missing something obvious.

Re: Binding NSTextField to an array

2017-03-06 Thread Jonathan Mitchell
Sounds like NSValueTransformer is in fact what you need. It can take in your NSArray ref and spit out a single NSString that the NSTextField binding can live with. Defining NSValueTransformer subclass for every binding can be a pain. So I use a block approach. This has the big advantage that you

Re: Binding NSTextField to an array

2017-03-06 Thread Jeremy Hughes
> From what I understand of your example, you’re not “binding” anything in a > Cocoa sense. In the case of the single value, the text field is set up via the Bindings pane of Interface Builder so that “Value" says “Bind to File’s Owner” with a model key path of self.value. (And

Re: Binding NSTextField to an array

2017-03-06 Thread Mike Abdullah
From what I understand of your example, you’re not “binding” anything in a Cocoa sense. What you is an NSArrayController. Bind your text field to the array controller. Supply the array controller with content, and have it derive the selected value, be it single or multiple. > On 6 Mar 2

Binding NSTextField to an array

2017-03-06 Thread Jeremy Hughes
Hi, This seems like an elementary question. I’d like to bind an NSTextField to an array of numerical values, so that the text field will either display a single value if the values are identical or will display a multiple values marker if the values are different. Using Swift, I can bind a tex

Re: NSCollectionView isn't playing nicely with selection binding

2016-11-06 Thread Rob Petrovec
ler's > selectionIndexes. The trouble is, changes to the collection view's selection > don't notify the selectionIndexes binding. I've subclasses the collection > view just so I could override all the various selection methods to see what's > going on. Th

NSCollectionView isn't playing nicely with selection binding

2016-11-02 Thread Steve Mills
the collection view's selection don't notify the selectionIndexes binding. I've subclasses the collection view just so I could override all the various selection methods to see what's going on. The methods that use a set of NSIndexPath are always called, but the NSIndexSet vers

Re: Selected value binding in popups

2016-06-16 Thread Rick Mann
acks the >> NSArrayController (in the case where the selected device disappears): I >> assign a new array to the property, and the selected item in the popup menu >> changes to be the object description for the AVCaptureDevice object still in >> the selected property. >

Re: Selected value binding in popups

2016-06-16 Thread Ken Thomases
ay to the property, and the selected item in the popup menu > changes to be the object description for the AVCaptureDevice object still in > the selected property. > > IB doesn't let me bind to selected value when I'm binding to selected object. > Is there anything I can do

Re: Selected value binding in popups

2016-06-16 Thread Keary Suska
array to the property, and the selected item in the popup menu > changes to be the object description for the AVCaptureDevice object still in > the selected property. > > IB doesn't let me bind to selected value when I'm binding to selected object. > Is there anything

Selected value binding in popups

2016-06-15 Thread Rick Mann
AVCaptureDevice object still in the selected property. IB doesn't let me bind to selected value when I'm binding to selected object. Is there anything I can do here? -- Rick Mann rm...@latencyzero.com ___ Cocoa-dev mailing list (Cocoa-dev

Re: TreeController and "selection" Binding

2016-02-12 Thread Ken Thomases
to a > local variable, which uses the property observers of Swift ( willSet and > newValue) to call a function which highlights the selected text in the > “source” > > Ideally, I would like to omit the outlet/programmtically binding steps and > bind the treeControllers selec

Re: TreeController and "selection" Binding

2016-02-12 Thread Michael de Haan
> On Feb 12, 2016, at 2:52 PM, Quincey Morris > wrote: > > The difference between binding in IB and binding using code (if that’s what > you’ve been doing) is that with code you have a freer choice of binding > targets. To do the equivalent in IB, you might be forced

Re: TreeController and "selection" Binding

2016-02-12 Thread Quincey Morris
On Feb 12, 2016, at 14:24 , Michael de Haan wrote: > > using the “selectionIndexPaths” binding of the TreeController (from IB) I > should be able to use that information to trace it back ( with key paths) to > my model instance Not unless you’ve provided the necessary k

Re: TreeController and "selection" Binding

2016-02-12 Thread Michael de Haan
> On Feb 12, 2016, at 2:16 PM, Quincey Morris > wrote: > > On Feb 12, 2016, at 14:00 , Michael de Haan <mailto:m...@comcast.net>> wrote: >> >> I could not get from that binding to the actual instance of my model. There >> does not seem to be an “Arr

Re: TreeController and "selection" Binding

2016-02-12 Thread Quincey Morris
On Feb 12, 2016, at 14:00 , Michael de Haan wrote: > > I could not get from that binding to the actual instance of my model. There > does not seem to be an “Array.ObjectAtThisIndexPath" which I think you are > alluding to? Ie bind this to a local variable (indexPath

Re: TreeController and "selection" Binding

2016-02-12 Thread Michael de Haan
> On Feb 12, 2016, at 9:16 AM, Quincey Morris > wrote: > > On Feb 12, 2016, at 07:04 , Michael de Haan <mailto:m...@comcast.net>> wrote: >> >> Ideally, I would like to omit the outlet/programmtically binding steps and >> bind the treeControllers select

Re: TreeController and "selection" Binding

2016-02-12 Thread Quincey Morris
On Feb 12, 2016, at 07:04 , Michael de Haan wrote: > > Ideally, I would like to omit the outlet/programmtically binding steps and > bind the treeControllers selection in IB to my local variable. So, the > “clunkiness” was a referral to the outlets and programmatic binding. Howe

Re: TreeController and "selection" Binding

2016-02-12 Thread Michael de Haan
> > Or are you saying you’re currently observing the tree controller’s > “selectionIndexPaths” *property* (not *binding*) using KVO or something else, > and *that’s* what’s clunky? > > Hi Quincey I see your source of confusion… did not do a very good job explaining the model and

Re: TreeController and "selection" Binding

2016-02-11 Thread Quincey Morris
On Feb 11, 2016, at 13:26 , Michael de Haan wrote: > > Currently, I obtain the “selection” of the treeController by implementing and > outlet to the controller, and using the “selectionIndexPaths” binding to > update a local variable which holds the selected range information.

TreeController and "selection" Binding

2016-02-11 Thread Michael de Haan
original source. Currently, I obtain the “selection” of the treeController by implementing and outlet to the controller, and using the “selectionIndexPaths” binding to update a local variable which holds the selected range information. From then, another function implements the highlight. It works

Re: Trouble w/ key-value binding validation

2015-11-07 Thread Luc Van Bogaert
> On 07 Nov 2015, at 10:09, Luc Van Bogaert wrote: > >> On 07 Nov 2015, at 01:56, Quincey Morris >> > <mailto:quinceymor...@rivergatesoftware.com>> wrote: >> >> On Nov 6, 2015, at 15:23 , Luc Van Bogaert > <mailto:luc.van.boga...@me.com>>

Re: Trouble w/ key-value binding validation

2015-11-07 Thread Luc Van Bogaert
> On 07 Nov 2015, at 01:56, Quincey Morris > wrote: > > On Nov 6, 2015, at 15:23 , Luc Van Bogaert <mailto:luc.van.boga...@me.com>> wrote: >> >> In a tableview with a content binding and a value binding on the table cell >> view textfields to the m

Re: Trouble w/ key-value binding validation

2015-11-06 Thread Quincey Morris
On Nov 6, 2015, at 15:23 , Luc Van Bogaert wrote: > > In a tableview with a content binding and a value binding on the table cell > view textfields to the model's objectValue keypaths, I'm having trouble > getting the key-value validation to work correctly. In the

Trouble w/ key-value binding validation

2015-11-06 Thread Luc Van Bogaert
Hi, In a tableview with a content binding and a value binding on the table cell view textfields to the model's objectValue keypaths, I'm having trouble getting the key-value validation to work correctly. In the model class, I have implemented the required validation methods (v

Re: View based table binding to alternate object?

2015-08-11 Thread Quincey Morris
s no errors, but won't > actually update the view. > > I'll see if I can dig into tableView:viewForTableColumn:row: to find any > answers - but keep in mind, this is all bindings related. I haven't used any > delegate or datasource methods as of yet to do anything. Yes, but t

Re: View based table binding to alternate object?

2015-08-11 Thread Quincey Morris
ath), and the table just displays the default text > repeated. I would start by changing the “B” in the binding to something invalid like “C”, to make sure that you get an error message at all. If you do, then you need to investigate the value of ‘staticObjectController.selection.B’ at t

View based table binding to alternate object?

2015-08-11 Thread Jim Thomason
This example is a little contrived, because I'm struggling with how to phrase it properly. The answer to the question might be as simple as "You can't do that,", and I'm cool if it is, I just want to confirm I'm not doing something stupid. I have an array controller of mutable dictionaries. It has

Re: How to debug a binding exception?

2015-06-02 Thread John Brownie
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.co

Re: How to debug a binding exception?

2015-06-02 Thread Quincey Morris
On Jun 2, 2015, at 02:36 , John Brownie wrote: > > * thread #1: tid = 0x51dfe8, 0x7fff9393b743 > libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop > reason = breakpoint 1.1 Have you tried continuing after the exception? The next thing it should do is log the exce

How to debug a binding exception?

2015-06-02 Thread John Brownie
ff9350d5c9 libdyld.dylib`start + 1 My problem is that I don't know what binding would be causing the problem. Is there a way to find out which it is? John -- John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg Summer Institute of Linguistics | Mussau-Emira language, Mussau Is. Uk

Re: Binding to selection of NSArrayController

2015-02-03 Thread Marek Hrušovský
bject in the table. I would have thought that > I could do this just by binding the relevant NSTextField to > MessageArray.selection.myExtendedInformationProperty. This works up to a > point, in that I do see text appearing in the text field. However it does > not update when the s

Re: Binding to a view's model object

2015-01-25 Thread Keary Suska
'objectValue.someProperty'. The NSTableCellView is really the VC and > objectValue is the model object. Of course--in this case, NSTableCellView is really just acting as an intermediary for its subviews. In a way, the subviews are really binding *through* NSTableCellView , alth

Re: Binding to a view's model object

2015-01-25 Thread Roland King
> On 25 Jan 2015, at 23:15, Keary Suska wrote: > > On Jan 25, 2015, at 3:34 AM, Roland King wrote: > >> I have a xib with a top-level view and a bunch of subviews which represents >> one view of a given model object. The top-level NSView subclass has a >> readwrite property which is the mode

Re: Binding to a view's model object

2015-01-25 Thread Sandor Szatmari
I think you can bring an object controller into your xib from the IB pallet. Bind the content object of the controller to your NSView subclass and expose the binding of modelObject.someStringProperty through the object controller's attributes inspector panel. The all your subviews will

Re: Binding to a view's model object

2015-01-25 Thread Jonathan Mitchell
> On 25 Jan 2015, at 10:34, Roland King wrote: > > I have a xib with a top-level view and a bunch of subviews which represents > one view of a given model object. The top-level NSView subclass has a > readwrite property which is the model object of which it's a view. I thought > this was a p

Re: Binding to a view's model object

2015-01-25 Thread Keary Suska
the model object? Or own the NSViewController(s) that do? These would represent standard patterns and don't seem clunky. Note, however, that objects of NSWindowController and NSViewController have some built-in binding break-down when they are released, and are usually more bi

Binding to a view's model object

2015-01-25 Thread Roland King
I have a xib with a top-level view and a bunch of subviews which represents one view of a given model object. The top-level NSView subclass has a readwrite property which is the model object of which it's a view. I thought this was a pretty standard pattern, especially in OSX which only just rec

NSTableView binding and clickedRow returning -1

2015-01-05 Thread Hajder Rabiee
-binding-and-clickedrow.html http://www.geektheory.ca/blog/nstableview-and-nsoutlineview-method-clickedrow-always-returning-1-on-double-click-action/ The action target is called but [_tableView clickedRow] always return -1. Also the parameter for the selector, should it contain all the objects in the

Re: Binding a unique-selection checkbox in a table view?

2014-11-23 Thread Jerry Krinock
The code posted by Lee Ann Rucker is good. It implements the ‘activeJob’ in the data model as I recommended. Your “data model” can include whatever classes you need to model your data, not just Job objects. Lee Ann is proposing that your data model also contain a single instance of a DataMode

RE: Binding a unique-selection checkbox in a table view?

2014-11-22 Thread Lee Ann Rucker
opers Subject: Re: Binding a unique-selection checkbox in a table view? > On Nov 22, 2014, at 03:17 , Jerry Krinock wrote: > > >> On 2014 Nov 21, at 19:09, Rick Mann wrote: >> >> In an OS X app I have an NSTableView that binds to an array of Job objects. >> I

Re: Binding a unique-selection checkbox in a table view?

2014-11-22 Thread Rick Mann
> On Nov 22, 2014, at 03:17 , Jerry Krinock wrote: > > >> On 2014 Nov 21, at 19:09, Rick Mann wrote: >> >> In an OS X app I have an NSTableView that binds to an array of Job objects. >> I'd like to have a checkbox column that the user can check that indicates >> the "active" job. There shou

Re: Binding a unique-selection checkbox in a table view?

2014-11-22 Thread Jerry Krinock
> On 2014 Nov 21, at 19:09, Rick Mann wrote: > > In an OS X app I have an NSTableView that binds to an array of Job objects. > I'd like to have a checkbox column that the user can check that indicates the > "active" job. There should be only one of these. Is there a way to bind the > value of

Re: Binding a unique-selection checkbox in a table view?

2014-11-21 Thread Lee Ann Rucker
On Nov 21, 2014, at 4:20 PM, Rick Mann wrote: > >> On Nov 21, 2014, at 16:19 , Lee Ann Rucker wrote: >> >> I think binding to a method would be simplest; > > You mean wiring the column's action up? Oops, yeah, so many ways to describe things... > >

Re: Binding a unique-selection checkbox in a table view?

2014-11-21 Thread Rick Mann
> On Nov 21, 2014, at 16:19 , Lee Ann Rucker wrote: > > I think binding to a method would be simplest; You mean wiring the column's action up? > if you bound it to a value on File's Owner or some other object you'd still > have to figure out which one of them w

Re: Binding a unique-selection checkbox in a table view?

2014-11-21 Thread Lee Ann Rucker
I think binding to a method would be simplest; if you bound it to a value on File's Owner or some other object you'd still have to figure out which one of them was clicked. IBAction gives you the sender, then you can do NSInteger row = [tableView rowForView:sender]; since tha

Binding a unique-selection checkbox in a table view?

2014-11-21 Thread Rick Mann
In an OS X app I have an NSTableView that binds to an array of Job objects. I'd like to have a checkbox column that the user can check that indicates the "active" job. There should be only one of these. Is there a way to bind the value of that column to something other than the Job for that row,

Trouble binding an NSTextField value in Swift

2014-10-19 Thread Rick Mann
I have a Swift ViewController that has an NSTextField, and a property var port: Port?. Port is an Objective-C class. The text field's value is bound to port.name. Unfortunately, setting port seems to have no effect on the label. I can bind the label to other things (like the view controller's r

Re: Binding to selection of NSArrayController

2014-09-23 Thread Jonathan Taylor
ndant in the whole thing - it's declared as a backing store, but this way I don't actually end up accessing it for anything. There's a rather long and redundant-seeming chain running from NSArray instance variable -> property -> binding -> NSArrayController -> IBOu

Re: Binding to selection of NSArrayController

2014-09-23 Thread Quincey Morris
On Sep 23, 2014, at 11:36 , Lee Ann Rucker wrote: > On Sep 23, 2014, at 9:15 AM, Jonathan Taylor > wrote: >> >> [*] One slight glitch - if I add an object to the NSMutableArray then it >> does not immediately show up in the table, I have to call >> will/didChangeValueForKey on the property t

Re: Binding to selection of NSArrayController

2014-09-23 Thread Lee Ann Rucker
On Sep 23, 2014, at 9:15 AM, Jonathan Taylor wrote: > > > > > [*] One slight glitch - if I add an object to the NSMutableArray then it does > not immediately show up in the table, I have to call > will/didChangeValueForKey on the property that returns the array. I don’t > know if that is

Re: Binding to selection of NSArrayController

2014-09-23 Thread Jonathan Taylor
troller. That all seems to work fine, and the object > properties are listed in the table[*]. > > Underneath the table I want to display some more detailed information about > the currently-selected object in the table. I would have thought that I cou

Binding to selection of NSArrayController

2014-09-23 Thread Jonathan Taylor
would have thought that I could do this just by binding the relevant NSTextField to MessageArray.selection.myExtendedInformationProperty. This works up to a point, in that I do see text appearing in the text field. However it does not update when the selection in the table view changes, which

Re: Binding Exception

2014-09-15 Thread Richard Charles
On Sep 15, 2014, at 2:52 PM, Keary Suska wrote: > Yes, The exception will leave your app in an invalid state. Thank you, I was not aware of that. > The breakpoint catches before the exception would be logged to console. > Simply keep clicking the "continue" button in the debugger until it outp

Re: Binding Exception

2014-09-15 Thread Mike Abdullah
On 15 Sep 2014, at 21:42, Richard Charles wrote: > I have a binding that throws an Objective-C exception but the console > displays no output and the application does not crash but rather the > application runs fine. Enabling NSBindingDebugLogLevel 1 does not help, the > c

Re: Binding Exception

2014-09-15 Thread Keary Suska
On Sep 15, 2014, at 2:42 PM, Richard Charles wrote: > I have a binding that throws an Objective-C exception but the console > displays no output and the application does not crash but rather the > application runs fine. Enabling NSBindingDebugLogLevel 1 does not help, the > c

Binding Exception

2014-09-15 Thread Richard Charles
I have a binding that throws an Objective-C exception but the console displays no output and the application does not crash but rather the application runs fine. Enabling NSBindingDebugLogLevel 1 does not help, the console still displays nothing. I am using Xcode 5.1.1 with the All Exceptions

Re: NSTextField Binding

2014-08-07 Thread Roland King
> On 8 Aug 2014, at 5:06 am, Sean McBride wrote: > > On Thu, 7 Aug 2014 14:32:47 -0600, koko said: > >> I have bound an NSTextField’s value binding to a property in class A > > Make sure the property is not weak, which doesn't support KVO. Weak properties suppor

Re: NSTextField Binding

2014-08-07 Thread koko
On Aug 7, 2014, at 2:55 PM, Ken Thomases wrote: > _How_ did you update the property? You must do it in a KVO-compliant manner, > which usually means calling the setter. I believe this is KVO-compliant … but I could be wrong ! @interface Controller : NSObject { int height; } @property

Re: NSTextField Binding

2014-08-07 Thread Sean McBride
On Thu, 7 Aug 2014 14:32:47 -0600, koko said: >I have bound an NSTextField’s value binding to a property in class A Make sure the property is not weak, which doesn't support KVO. >There are no warnings or error messages. You could try turning on NSBindingDebugLogLevel. See TN21

Re: NSTextField Binding

2014-08-07 Thread Keary Suska
On Aug 7, 2014, at 2:32 PM, koko wrote: > I have bound an NSTextField’s value binding to a property in class A > > I update the property in class A but the NSTextField does not reflect the > update. > > There are no warnings or error messages. > > Where should I look

Re: NSTextField Binding

2014-08-07 Thread Ken Thomases
On Aug 7, 2014, at 3:32 PM, koko wrote: > I have bound an NSTextField’s value binding to a property in class A > > I update the property in class A but the NSTextField does not reflect the > update. > > There are no warnings or error messages. > > Where should I look

NSTextField Binding

2014-08-07 Thread koko
I have bound an NSTextField’s value binding to a property in class A I update the property in class A but the NSTextField does not reflect the update. There are no warnings or error messages. Where should I look to understand / resolve this? -koko

Re: KVC, binding multiple properties, top level object

2014-07-17 Thread Uli Kusterer
On 14 Jul 2014, at 19:41, Sean McBride wrote: > On Mon, 14 Jul 2014 09:11:58 -0700, Jens Alfke said: >> But I agree about NSNumbers being more complicated. The only time you >> need to use an NSNumber is if you want to stick a number into a >> collection or otherwise need to treat it as an object.

Re: KVC, binding multiple properties, top level object

2014-07-14 Thread Sean McBride
On Mon, 14 Jul 2014 09:11:58 -0700, Jens Alfke said: >But I agree about NSNumbers being more complicated. The only time you >need to use an NSNumber is if you want to stick a number into a >collection or otherwise need to treat it as an object. It's also useful for optional values, where a nil NS

Re: KVC, binding multiple properties, top level object

2014-07-14 Thread Jens Alfke
On Jul 14, 2014, at 3:44 AM, Uli Kusterer wrote: > NSNumber is more complicated to use (constant calls to integerValue and > valueWithInteger: etc. to actually work with them) and carries a bit more > overhead (it creates a new NSObject subclass on the heap every time “Every time" hasn’t been

Re: KVC, binding multiple properties, top level object

2014-07-14 Thread Uli Kusterer
On 13 Jul 2014, at 23:29, Trygve Inda wrote: > NSNumber just seem a bit more flexible since they can be added to > dictionaries (such as in the userInfo of a Notification). NSNumber is more complicated to use (constant calls to integerValue and valueWithInteger: etc. to actually work with them)

Re: KVC, binding multiple properties, top level object

2014-07-14 Thread Uli Kusterer
Graham Cox wrote: > NSInteger is a typedef for 'long', which size depends on the platform (32/64 > bit), so valueForKey: will wrap it as a NSNumber using type 'long’. That’s not quite true. While it is the desired effect that NSInteger behave like long, NSInteger was used because the spots in th

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
> > On 14 Jul 2014, at 7:29 am, Trygve Inda wrote: > >> Is NSInteger treated the same way? This page does not mention it: > > NSInteger is a typedef for 'long', which size depends on the platform (32/64 > bit), so valueForKey: will wrap it as a NSNumber using type 'long'. That's > safe across a

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
> > On 14 Jul 2014, at 7:29 am, Trygve Inda wrote: > >> Is NSInteger treated the same way? This page does not mention it: > > NSInteger is a typedef for 'long', which size depends on the platform (32/64 > bit), so valueForKey: will wrap it as a NSNumber using type 'long'. That's > safe across a

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Graham Cox
On 14 Jul 2014, at 7:29 am, Trygve Inda wrote: > Is NSInteger treated the same way? This page does not mention it: NSInteger is a typedef for 'long', which size depends on the platform (32/64 bit), so valueForKey: will wrap it as a NSNumber using type 'long'. That's safe across archives that

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
> > On 12 Jul 2014, at 10:05 pm, Trygve Inda wrote: > >> ---someProperty (Custom NSObject) >> --propertyA (NSNumber) >> --propertyB (NSNumber) >> --propertyC (NSNumber) >> >> Properties A, B and C use a binding to connect them to

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
> > On 12 Jul 2014, at 10:05 pm, Trygve Inda wrote: > >> ---someProperty (Custom NSObject) >> --propertyA (NSNumber) >> --propertyB (NSNumber) >> --propertyC (NSNumber) >> >> Properties A, B and C use a binding to connect them to

Re: KVC, binding multiple properties, top level object

2014-07-12 Thread Graham Cox
On 12 Jul 2014, at 10:05 pm, Trygve Inda wrote: > ---someProperty (Custom NSObject) > --propertyA (NSNumber) > --propertyB (NSNumber) > --propertyC (NSNumber) > > Properties A, B and C use a binding to connect them to a user interface item > with somethi

Re: KVC, binding multiple properties, top level object

2014-07-12 Thread Ken Thomases
On Jul 12, 2014, at 7:05 AM, Trygve Inda wrote: > My object layout looks like: > > -MyObject (custom NSObject) > ---someProperty (Custom NSObject) > --propertyA (NSNumber) > --propertyB (NSNumber) > --propertyC (NSNumber) > > Properties A, B and C use a b

KVC, binding multiple properties, top level object

2014-07-12 Thread Trygve Inda
My object layout looks like: -MyObject (custom NSObject) ---someProperty (Custom NSObject) --propertyA (NSNumber) --propertyB (NSNumber) --propertyC (NSNumber) Properties A, B and C use a binding to connect them to a user interface item with something like: Bind to MyObject with key

Re: NSDatePicker : Displaying and binding to nil.

2014-05-20 Thread Jonathan Mitchell
On 20 May 2014, at 11:35, Rob Petrovec wrote: > I haven’t looked at your code, but why not use a nil placeholder value when > binding? Pass an options dictionary with a key / value pair of > NSNullPlaceholderBindingOption / to the > -bind:… method, or specify the value

Re: NSDatePicker : Displaying and binding to nil.

2014-05-20 Thread Rob Petrovec
I haven’t looked at your code, but why not use a nil placeholder value when binding? Pass an options dictionary with a key / value pair of NSNullPlaceholderBindingOption / to the -bind:… method, or specify the value for the nil placeholder in the nib. Something like: [datePicker bind

NSDatePicker : Displaying and binding to nil.

2014-05-15 Thread Jonathan Mitchell
NSDatePicker cannot display or bind to a nil dateValue so I have put together something that might be of use when binding to NSDate instances that might be nil. https://github.com/ThesaurusSoftware/TFDatePicker Subclassing NSDatePickerCell is made difficult because NSDatePickerCell does not

Re: Problems binding NSViewController's representedObject

2014-03-22 Thread Rob Nikander
There's an answer on stackoverflow. I wasn't keeping a strong reference to the ViewController. Doh. On Sat, Mar 22, 2014 at 8:54 AM, Rob Nikander wrote: > Hi, > > I've posted here: > http://stackoverflow.com/questions/22573176/why-is-nsviewcontroller-not-binding-re

Problems binding NSViewController's representedObject

2014-03-22 Thread Rob Nikander
Hi, I've posted here: http://stackoverflow.com/questions/22573176/why-is-nsviewcontroller-not-binding-representedobject There's code and screenshots in the above link, but the basics are this: I've created an `NSViewController` subclass, with a corresponding xib. I try to set

Re: Binding not setting model property

2014-01-19 Thread Ken Thomases
ue"' on it just raises as > exception, so I assumed bindings was doing something clever under the hood to > know that the value binding for an NSTextField actually means stringValue;, > or possibly it's using another method entirely which isn't called by > setStrin

Re: Binding not setting model property

2014-01-18 Thread Quincey Morris
On Jan 18, 2014, at 22:44 , Roland King wrote: > What derived property can I write on the view which removes that dependency? On Jan 18, 2014, at 20:54 , Quincey Morris wrote: > create a derived property on the view or window controller that’s based on > the data model property Sorry, what

Re: Binding not setting model property

2014-01-18 Thread Roland King
elected URL of that wants to be set back on the codeURL property. Currently I have the model object as a property of the view and in the NSOpenPanel callback I'm doing [ self.modelObject setCodeURL:newURL ]; which sets the URL and the change propagates back to the text view via the

Re: Binding not setting model property

2014-01-18 Thread Quincey Morris
On Jan 18, 2014, at 20:39 , Roland King wrote: > Really does look like the binding code only fires for at the end of > ..didFinishEditing: and not for any programatic set of any property on the > object, at least not one I've been able to find. That actually makes a lot of sen

Re: Binding not setting model property

2014-01-18 Thread Roland King
:.. ] but that just throws an exception that setValue: isn't >> implemented on NSTextField, which it isn't, so I went back to >> setStringValue: But setting stringValue: changes the on-screen string, but >> doesn't trigger the binding to send the string bac

Re: Binding not setting model property

2014-01-18 Thread Quincey Morris
emented on NSTextField, which it isn't, so I went back to setStringValue: > But setting stringValue: changes the on-screen string, but doesn't trigger > the binding to send the string back the other way. I think you need to setObjectValue, not setStringValue. “objectValue” is the

Re: Binding not setting model property

2014-01-18 Thread Roland King
.. right so if I actually edit the NSTextField on-screen (it wasn't editable before, I made it so) *THEN* the binding gets called in the way I expected. So it would seem that only a user-initiated change of the value fires the binding in reverse (which is what the example binding code i

Re: Binding not setting model property

2014-01-18 Thread Roland King
#x27;t, so I went back to setStringValue: But setting stringValue: changes the on-screen string, but doesn't trigger the binding to send the string back the other way. That was one point of confusion for me right at the start. IB binds the 'value' property but as far as I could tell,

Re: Binding not setting model property

2014-01-18 Thread Dave Fernandes
How are you setting up the binding? Normally you bind to the value property of the NSTextField (not stringValue). See Cocoa Bindings Reference (NSTextField Bindings). On Jan 18, 2014, at 9:41 PM, Roland King wrote: > I have a model object with a codeURL property which is readwrite and is

  1   2   3   4   5   6   7   8   9   10   >