• 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: Need help for data validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help for data validation


  • Subject: Re: Need help for data validation
  • From: Andre Masse <email@hidden>
  • Date: Tue, 16 Aug 2011 15:18:21 -0400

Answering my own question:

Read the documentation on:

- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor

Cheers,

Andre Masse

On 16/08/2011, at 12:21 , Andre Masse wrote:

> Hi,
>
> I need to validate input when the user enters data on a particular cell (caseNumber) in a table view. Not using coredata but data is stored in a Postgresql database. Here's what I need to ensure:
>
> 1- only digits
> 2- dont already exists in the database
> 3- dont already exists in the tableview's datasource
> 4- need to stay on the cell until valid data is entered.
>
> 1- easily done use key-value validation (validateCaseNumber:error:)
> 2- could be done using key-value validation but this imply opening a new database connection (already have one open in master/detail model)
> 3- this cant be done using key-value validation (no access to the array)
>
> I'm currently using this in a tableview delegate:
>
> - (BOOL)control:(NSControl *)control isValidObject:(id)obj
>
> Which is working fine except that I haven't found a way to customize the error string when returning NO in the above method. Am I missing something obvious?
>
> Thanks,
>
> Andre Masse
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Need help for data validation (From: Andre Masse <email@hidden>)

  • Prev by Date: Re: How can I prevent drag-and-drop initiation in an NSTextField
  • Next by Date: Re: Properly wrapping non-contiguous NSTextViews
  • Previous by thread: Need help for data validation
  • Next by thread: Exact behavior of NSLiteralSearch in string compare?
  • Index(es):
    • Date
    • Thread