We don't have quite enough information to help you solve your specific issue. That said, I tried the following code to initialise yours:
NSArray *ary = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObject:[NSDecimalNumber decimalNumberWithString:@"0"] forKey:@"actualCost"],
[NSDictionary dictionaryWithObject:[NSDecimalNumber decimalNumberWithString:@"4"] forKey:@"actualCost"],
[NSDictionary dictionaryWithObject:[NSDecimalNumber decimalNumberWithString:@"5"] forKey:@"actualCost"],
[NSDictionary dictionaryWithObject:[NSDecimalNumber decimalNumberWithString:@"2"] forKey:@"actualCost"], nil];
NSEnumerator *e = [ary objectEnumerator];
NSDecimalNumber *currentTotal = [NSDecimalNumber zero];
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
The above code seems to work with no dramas, so I'll have to second @NSResponder's comment asking for your initialisation code.
Also, the following line of your sample has (what I assume to be) unintended behaviour:
NSLog(@"decimalNumberByAdding gives: %@",[numberFormatter stringFromNumber:[currentTotal decimalNumberByAdding: [object objectForKey:@"actualCost"]]]);
It does not cause your total to be incorrect, but the log output will be misleading. By the time the machine has reached that line, it will have already added the current sum and your log will make it appear to have been added twice. I think you probably want the following:
NSLog(@"decimalNumberByAdding gives: %@", [numberFormatter stringFromNumber:currentTotal]);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…