I have a line
bookval_int_curr = [str1 intValue] - [str2 intValue];
But for some reason bookval_int_curr seems to be returning nil. Am I doing something wrong ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I Assume that str1 and str2 are strings. Then if they doesn’t begin with a valid decimal text representation of a number, NSString would return 0. 0 – 0 = 0.
If you are trying to assign 0 to the object, then it’s address would be nil.