Reputation: 1416
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"
Upvotes: 1
Views: 748
Reputation: 11699
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__);
Upvotes: 6