• 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: Formatter Trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatter Trouble


  • Subject: Re: Formatter Trouble
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 11 Sep 2002 16:52:27 -0400

on 02-09-11 12:37 PM, Christian Weykopf at email@hidden wrote:

> in my application I try to prevent some NSTextfields from left blank.
> First try: textShouldEndEditing - nothing happens. Will only be called if
> I type a char and delete it then. ??_

By preventing fields from being "left blank," do you mean left blank when
the user closes the window, or what? Whatever user action you mean, find the
"should" delegate method or notification that is triggered when the user
attempts to do that, and check all the fields' contents for empty strings.
If you find some, return NO from the delegate method and put up sensible UI.

You can't use a formatter to check for an empty text field, because
formatters aren't triggered by ending editing with a field empty. Try it,
and you'll see this is so. I assume the reason is because it's normal to
leave fields empty. It isn't considered a formatting issue.

--

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: 
 >Formatter Trouble (From: Christian Weykopf <email@hidden>)

  • Prev by Date: Re: NSTextAttachmentCell redraw with new size
  • Next by Date: Re: [newbie] NSString code so it won't leak
  • Previous by thread: Formatter Trouble
  • Next by thread: Re: real authority on what needs to be released
  • Index(es):
    • Date
    • Thread