Wednesday, April 27, 2011

After decades of anticipation, the white iPhone has finally arrived.

Apple finally announced that the white iPhone will go on sale Thursday, and in a perfect world that would be fresh news. Not earth-shattering news, but an informative story for the folks who have been waiting for this oft-delayed gadget -- assuming those people still exist.
http://www.pcworld.com/article/226403/white_iphone_4_goes_on_sale_thursday.html

Thursday, April 21, 2011

UI Hacker - Code for Fun: iPhone: Get the class name of an object

iPhone: Get the class name of an object
Sometimes you want to know what type of object something is, when pulling it out of an array. In Obj-c there's a simple way to do that:

NSLog(@"object type = %@", [[myObject class] className]);
or
NSLog(@"object type = %@", [[myObject class] description]);
or!
if( [[myArray objectAtIndex:i] isKindOfClass:NSClassFromString(@"MyCustomClass")] ) { NSLog(@"it's a MyCustomClass"); }



UI Hacker - Code for Fun: iPhone: Get the class name of an object: "Sometimes you want to know what type of object something is, when pulling it out of an array. In Obj-c there's a simple way to do that: NS..."