PDA

View Full Version : Can't save calculated field to database




Helikutt
Apr 19, 2008, 11:49 AM
Hi

I'm building my first core-data application with Xcode 3.

I have a field "sum" on my form which calculates his value using 2 other textfields "num1" and "num2".
The calculation works fine but the value from sum field doesn't save to database.
When I retype the value manually then it saves

The only code I use is for calculation

@implementation MyDocument


- (IBAction)calculate:(id)sender {

double result = [num1 doubleValue] + [num2 doubleValue];
[sum setDoubleValue:result];

}

I hope there is a easy way to fix my problem.

Helikutt