Re: CoreData validation question
Re: CoreData validation question
- Subject: Re: CoreData validation question
- From: Steve Bird <email@hidden>
- Date: Mon, 26 Apr 2010 08:15:25 -0400
On Apr 26, 2010, at 7:51 AM, Arnold Nefkens wrote:
> Hello list,
>
> I have the following validation method, why is it not working?
>
> -(BOOL)validateNumberField2:(id *)ioValue error:(NSError **)outError
> {
> NSNumber *inputNumberField2 = *ioValue;
> NSNumber *numberField2Stat = self.numberField2;
> NSNumber *numberField1Stat = self.numberField1;
>
> if (numberField2Stat != 0) {
QUESTION: What data type is "numberField2Stat" ?
ANSWER: it's a POINTER to an NSNumber (not a numeric value).
therefore it's very likely to never be zero.
> if (inputNumberField2 <= numberField1Stat) {
QUESTION: What data type is "numberField1Stat" ?
ANSWER: it's a POINTER to an NSNumber (not a numeric value).
therefore ...... _____ ?
consider using the intValue of your NSNumbers.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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