Checking NSTextFields are not empty
Checking NSTextFields are not empty
- Subject: Checking NSTextFields are not empty
- From: "Ben O'Neill" <email@hidden>
- Date: Tue, 4 Jun 2002 21:04:45 +1000
Hello,
I want to check to see if a text field is empty when it is submitted.
My code looks like this currently, however it doesn't work:
if ( titleField != nil ) {
NSMutableDictionary *record = [[NSMutableDictionary alloc] init];
[record setObject:[titleField stringValue] 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);
}
How can I check this?
Thanks in Advance,
Ben O'Neill
_______________________________________________
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.