• 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: Checking NSTextFields are not empty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Checking NSTextFields are not empty (From: "Ben O'Neill" <email@hidden>)

  • Prev by Date: Checking NSTextFields are not empty
  • Next by Date: keyDown overriding
  • Previous by thread: Checking NSTextFields are not empty
  • Next by thread: keyDown overriding
  • Index(es):
    • Date
    • Thread