I am new to basic data and programming on iphone. Perhaps this is the obvious answer, so if anyone can point me to a textbook or other resource, it is very much appreciated! I have a main data object, which is a decimal type, since it deals with currency, and everything I read says that NSDecimalNumber is used when working with currency. At the same time, I cannot have my life determine how to set the value when inserting a new object. That's what i
NSManagedObjectContext *moc = [self.fetchedResultsController managedObjectContext];
Envelope *envelope = [NSEntityDescription insertNewObjectForEntityForName:@"Envelope"
inManagedObjectContext:moc];
[envelope setValue:@"Envelope 1" forKey:@"name"];
NSDecimalNumber *budgetNumber = [NSDecimalNumber decimalNumberWithDecimal:1.00];
[envelope setValue:budgetNumber forKey:@"budget"];
What am I doing wrong here? thanks in advance!
source
share