Simple question
Simple question
- Subject: Simple question
- From: Arnold Nefkens <email@hidden>
- Date: Thu, 22 Apr 2010 17:36:04 +0200
Hello list,
Im quite new, and probably missing something.
I want to do a calculation of three fields inside of a entity in CoreData.
Below is the code, what is wrong?
NSNumber *fieldOne = [managedObject valueForKey:@"key1"];
NSNumber *fieldTwo = [managedObject valueForKey:@"key2"];
NSNumber *fieldThree = [managedObject valueForKey:@"key3"];
if (fieldTwo > 0) {
NSNumber *answer = ((fieldTwo - fieldOne) + fieldThree);
[self.managedObject setValue:[answer intValue] forKey:@"key4"];
}
If I debug the right values are being shown in the fieldOne, fieldTwo and fieldThree. But the calculation answer is all the time out of scope.....
What am I missing?
hope someone can help...
Arnold Nefkens_______________________________________________
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