How can I log the current line via NSLog in Cocoa / Objective C?
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"
The __LINE__ macro provides an integer so you need to change your format string. Instead of %@ you need a %d.
NSLog(@"current line: %d",__LINE__);