• 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: NSRunAlertPanel-not working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunAlertPanel-not working?


  • Subject: Re: NSRunAlertPanel-not working?
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 16 Feb 2004 19:44:59 -0800

On Feb 16, 2004, at 6:50 PM, James McConnell wrote:

Greetings, all. I have a small personal app I'm working on, and I'm trying
to implement some user validation. I have a doc-based app with some text
fields. No big deal. I also have an NSNotification for each field to set a
value in a model object when focus is lost (using
NSControlTextDidEndEditingNotification). This is working fine. What I
would like to do is check if the field is blank after it's lost focus. If
it is, I want an alert panel telling the user they must enter a value. I
only need it to have one "OK" button, and then return focus to the text
field.

Rather than using notifications etc, you could implement a formatter:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSFormatter.html>

Better still, if you're using 10.3, use bindings and implement validation methods for your model class.

mmalc
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSRunAlertPanel-not working?
      • From: Dustin Voss <email@hidden>
    • Re: NSRunAlertPanel-not working?
      • From: James McConnell <email@hidden>
References: 
 >NSRunAlertPanel-not working? (From: James McConnell <email@hidden>)

  • Prev by Date: Re: Installer framework or .pkg format?
  • Next by Date: Re: NSRunAlertPanel-not working?
  • Previous by thread: Re: NSRunAlertPanel-not working?
  • Next by thread: Re: NSRunAlertPanel-not working?
  • Index(es):
    • Date
    • Thread