[Solved] Invalid Operands to binary expression (NSNumber* __strong and NSNumber*) [closed]


You can’t perform addition on NSnumber for this

NSNumber * totaldur =[NSNumber numberWithInteger:20];

totaldur = [NSNumber numberWithInteger:([number1 integerValue] + [[dict valueForKey:@"tracktime"] integerValue])];

//// first of all convert both numbers to same data type like (nsinteger,int,float) and then apply addition on them and in the end save sum in nsnumber object

Hope it helps

2

solved Invalid Operands to binary expression (NSNumber* __strong and NSNumber*) [closed]