Re: Properties and bindings

2008-09-26 Thread mmalc crawford
On Sep 24, 2008, at 4:32 PM, D.K. Johnston wrote: - (IBAction)buttonClick:(id)sender; @end Both properties are synthesized in the implementation files. Here's what buttonClick: does: [self.model changeMyInteger]; This method is not KVO compliant (

Re: Properties and bindings

2008-09-26 Thread D.K. Johnston
It's working now, but I don't understand why. I've got two objects: MyController and MyModel. The interesting parts of the headers look like this: @interface MyModel : NSObject { NSInteger myInteger; } @property(assign) NSInteger myInteger; - (void)changeMyInteger; @end @interface

Re: Properties and bindings

2008-09-23 Thread Shawn Erickson
On Mon, Sep 22, 2008 at 8:44 PM, D.K. Johnston <[EMAIL PROTECTED]> wrote: > Thanks for the explanations: it does make some kind of sense now. > > The reason I was looking at both forms is that I want the myInt property to > be read-only, but I want the MyObject instance to be able to set it. If I d

Re: Properties and bindings

2008-09-23 Thread Andrew Merenbach
On Sep 22, 2008, at 8:44 PM, D.K. Johnston wrote: Thanks for the explanations: it does make some kind of sense now. The reason I was looking at both forms is that I want the myInt property to be read-only, but I want the MyObject instance to be able to set it. If I do this: @prop

Re: Properties and bindings

2008-09-23 Thread Roland King
you mean you want it to be read-only for other users, but you want the object to be able to set it itself without jumping through hoops? There's something about this in the properties description in the objective-c documents. What I've been doing for this (ie having semi-private properties

Re: Properties and bindings

2008-09-23 Thread Jason Coco
On Sep 22, 2008, at 23:44 , D.K. Johnston wrote: Thanks for the explanations: it does make some kind of sense now. The reason I was looking at both forms is that I want the myInt property to be read-only, but I want the MyObject instance to be able to set it. If I do this: @prope

Re: Properties and bindings

2008-09-23 Thread D.K. Johnston
Thanks for the explanations: it does make some kind of sense now. The reason I was looking at both forms is that I want the myInt property to be read-only, but I want the MyObject instance to be able to set it. If I do this: @property(readonly) NSInteger myInt; I can't do this in M

Re: Properties and bindings

2008-09-22 Thread Jason Coco
On Sep 22, 2008, at 21:35 , D.K. Johnston wrote: I'm trying to learn how to use bindings. MyObject has an NSInteger myInt. I used @property and @synthesize to make myInt into a property. In IB I bound an NSTextField to the myInt property. Now when I do this: self.myInt = 123; wh

Re: Properties and bindings

2008-09-22 Thread Roland King
when you do self.myInt under the covers you're really doing [ self setMyInt:123 ], and that method is KVO compliant so it fires the property change notification the textfield needs. myInt = 123 just sets the variable directly and skips the property change notification. On Sep 23, 2008,

Re: Properties and bindings

2008-09-22 Thread Nick Zitzmann
On Sep 22, 2008, at 7:35 PM, D.K. Johnston wrote: I'm trying to learn how to use bindings. MyObject has an NSInteger myInt. I used @property and @synthesize to make myInt into a property. In IB I bound an NSTextField to the myInt property. Now when I do this: self.myInt = 123; w

Properties and bindings

2008-09-22 Thread D.K. Johnston
I'm trying to learn how to use bindings. MyObject has an NSInteger myInt. I used @property and @synthesize to make myInt into a property. In IB I bound an NSTextField to the myInt property. Now when I do this: self.myInt = 123; when initialising MyObject, the value shows up in the te