Monday, March 19, 2012

Making Quick Use of NSLog

This post has a lot of helpful pointers on using NSLog with Objective-C to dump objects and structures to the debugger console.

http://stackoverflow.com/questions/550195/is-it-possible-to-nslog-c-structs-like-cgrect-or-cgpoint

For those of us used to using Android logging away with "ToString()" methods is second nature and this is how I have been debugging / tracing my iOS applications.

I do appreciate that you can use IFDEF and DEBUG to control the code.


NSLog(@"%@", NSStringFromCGPoint(cgPoint));

...

NSStringFromCGPoint  NSStringFromCGSize  NSStringFromCGRect  

No comments: