Is it possible to log the current line number using NSLog in Cocoa / Objective C?
This is what I thought I should do:
NSLog(@"current line: %@ and value: %@",__LINE__,abc);
And I’m getting Thread 1: Program Received Signal: "EXC_BAD_ACCESS"
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.
The
__LINE__macro provides an integer so you need to change your format string. Instead of%@you need a%d.