Re: Checking NSTextFields are not empty
Re: Checking NSTextFields are not empty
- Subject: Re: Checking NSTextFields are not empty
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 4 Jun 2002 13:16:00 +0200
On Tuesday, June 4, 2002, at 01:04 PM, Ben O'Neill wrote:
Hello,
I want to check to see if a text field is empty when it is submitted.
tString=[titleField stringValue];
if ([tString length]>0)
{
NSMutableDictionary *record = [[NSMutableDictionary alloc] init];
[record setObject: tString forKey:@"Title"];
[record setObject:[directorField stringValue] forKey:@"Director"];
[record setObject:[yearField stringValue] forKey:@"Year"];
[record setObject:[maleField stringValue] forKey:@"Male"];
[record setObject:[femaleField stringValue] forKey:@"Female"];
[record autorelease];
return record;
}
else
{
NSBeep();
NSRunAlertPanel(@"Error!", @"The Title field cannot be empty",
@"OK",nil,nil);
}
_______________________________________________
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.