• 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: nsformatters and focus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nsformatters and focus


  • Subject: Re: nsformatters and focus
  • From: Bill Cheeseman <email@hidden>
  • Date: Thu, 20 Feb 2003 06:19:34 -0500

My experience is that isPartialStringValid... will always let you leave a
field blank, since leaving a field blank is often desired behavior even
though a non-blank entry must be formatted.

A good solution to prevent the user from leaving the textfield blank is to
implement the textShouldEndEditing: delegate method, and return NO from it
if [([fieldEditor string] isEqualToString:@""]).

on 03-02-19 11:42 PM, Jonathan Jackel at email@hidden wrote:

> Take a look at NSFormatter's isPartialStringValid... methods. You'll
> want to override to return NO when the user has not yet typed a good
> entry. IIRC, the user cannot leave the field until the formatter
> validates the entry.
>
> Jonathan
>
> On Wednesday, February 19, 2003, at 08:19 PM, Francisco Tolmasky wrote:
>
>> With Cocoa Frameworks formatters (such as date, number, etc.) you are
>> NOT allowed to leave focus if certain requirements are not met. In my
>> formatter, I'd like it to not allow the user to to leave focus unless
>> there is input, for example if he deletes all of "9999" to "", id like
>> it to force him to input something. How do I do this? (Hopefully
>> this can be done through the formatter and not through the
>> nstextfieldcell)
>>
>> Francisco Tolmasky
>> email@hidden
>> http://users.adelphia.net/~ftolmasky
>> _______________________________________________
>> cocoa-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.


--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: nsformatters and focus (From: Jonathan Jackel <email@hidden>)

  • Prev by Date: Re: Application Security...
  • Next by Date: [NSTableView] Is this a OS X 10.2 bug in NSTableView?
  • Previous by thread: Re: nsformatters and focus
  • Next by thread: Possible to use Cocoa views in a Carbon window?
  • Index(es):
    • Date
    • Thread