• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSTextField value without changing focus?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSTextField value without changing focus?


  • Subject: Re: Using NSTextField value without changing focus?
  • From: Koen van der Drift <email@hidden>
  • Date: Tue, 11 Sep 2012 12:41:55 -0400

On Tue, Sep 11, 2012 at 11:26 AM, Keary Suska <email@hidden> wrote:
> On Sep 11, 2012, at 7:17 AM, Koen van der Drift wrote:
>
>> And as a followup, I am using bindings to link the value of the
>> textfield to my controller to do the calculations. I als tried
>> checking "Continuously Updates Value" in IB, but that also didn't
>> work, I still need to unfocus the textfield for the new value to be
>> used.
>
> "Continuously Updates Value" is what you want, usually. I bet that if you put NSLogs in the setters you will find that they are being set immediately. If this isn't working, it means that your calculation method is not working on the same model as the bindings, or at least not an up-to-date copy, which is generally a bad idea. The calculation method should retrieve the values directly from the model owner on demand, which will do what you need.


Without being able to look at my project since I am not at my Mac, I'm
pretty sure I set it up correctly. The myViewController class which
does the calculations has @properties for the values stored in the
textfields, and in IB the textfields are bound to
myViewController.value1, etc. The are no setters/getters for these
values.

Another thought I had why it doesn't work, is that I connected a
formatter to the textfield in IB to allow integers only.  Could that
be related to what I am seeing?

Once I get back to my Mac, I'll check all bindings and try the
continously updates value box again.

- Koen.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using NSTextField value without changing focus?
      • From: Lee Ann Rucker <email@hidden>
References: 
 >Using NSTextField value without changing focus? (From: Koen van der Drift <email@hidden>)
 >Re: Using NSTextField value without changing focus? (From: Markus Spoettl <email@hidden>)
 >Re: Using NSTextField value without changing focus? (From: Koen van der Drift <email@hidden>)
 >Re: Using NSTextField value without changing focus? (From: Koen van der Drift <email@hidden>)
 >Re: Using NSTextField value without changing focus? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?
  • Next by Date: Re: binding an array controller to columns in an NSTableView
  • Previous by thread: Re: Using NSTextField value without changing focus?
  • Next by thread: Re: Using NSTextField value without changing focus?
  • Index(es):
    • Date
    • Thread