Re: NSRunAlertPanel-not working?
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.