Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Need help for data validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help for data validation



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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.