我正在使用下面的代码来获取我的核心数据属性中的值,但我不知道是否可以提取并将它们相加,我想知道是否有人可以帮助我有了这个:
AppDelegate *appDelegate =[[UIApplication sharedApplication] delegate];
self.contextTotal=[appDelegate managedObjectContext];
NSEntityDescription *entity= [NSEntityDescription entityForName:@"CellSave" inManagedObjectContext:contextTotal];
NSFetchRequest *request= [[NSFetchRequest alloc] init];
[request setEntity:entity];
[request setResultType:NSDictionaryResultType];
[request setReturnsDistinctResults:YES];
[request setPropertiesToFetch:[NSArray arrayWithObject:@"smtrCbrData"]];
NSArray *objects= [contextTotal executeFetchRequest:request error:nil];
NSLog (@"results: %@",objects);
结果是:
Structure[1595:11603] results: (
{
smtrCbrData = "\U20ac 770.00";
},
{
smtrCbrData = "\U20ac 3,080.00";
}
是否可以获得数字并将它们相加?我怎么能这样做?
由于