background preloader

Dev iPhone

Facebook Twitter

Learn iOS, Cocos2d & Appcelerator Titanium. Overriding NSObject Description Method. No doubt NSLog is your friend, I use it frequently to print messages to the console during development.

Overriding NSObject Description Method

Actually, I use a variation of the NSLog that prints messages to the console sans date, time and object information, you can read about my approach here: Yet Another Debug Output (NSLog Replacement) In this tip I’ll cover something similar as it relates to printing debug information to the console, specifically, overriding the description method of an object to provide information about instance variables.

NSObject and description method All objects inherit from NSObject, which exposes a method named description. By default this method prints the object name and its address in memory. [iOS dev:tips]; Mac. Iphone 4. iPhone. Développement iPhone. Dev iphone. Developpement. Phone Dev.