Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting an error when this line of code runs, I am unfamiliar with NSDecimalNumber so Im not really sure what is wrong with this line and Xcode is not giving me any error until I actually run the code.

Objective-C
if ([unit1 isEqualToString: [_Distance objectAtIndex:0]])
        universalAns = [num1 decimalNumberByMultiplyingBy: (NSDecimalNumber*)[NSDecimalNumber numberWithDouble:0.0254]];


here is the debugger output up to this point:

self (ViewController *) 0x8c8cd10
unit1 = (__NSCFConstantString *) @"inches"
universalAns NSDecimalNumber * nil
num1 (__NSCFNumber *) (double)0
_Distance (__NSArrayI *) @"8 objects"

Any ideas would be helpful,
Thanks in advance!
Posted

1 solution

I solved it, num1 was not a NSDecimalNumber for some reason.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900