Welcome to Cocoa / iPhone programming!
On May 20, 2009, at 8:43 AM, Jeff Decker wrote:
NSLog(@"Is Kind of NSString: %@", [[step class] isKindOfClass:
[NSString class]]);
Follow the trail o' definitions... cmd-double-click on isKindOfClass:
ought to lead you to this:
- (BOOL)isKindOfClass:(Class)aClass;
And cmd-double-click on the BOOL return type will lead here:
typedef signed char BOOL;
Thus, a BOOL is not an object. The only reason why your code didn't
crash is because NO is coincidentally equivalent to Nil/NULL/nil. If
it had returned YES, you would have crashed on the above line of code.
So... how to turn a BOOL into a string? For purposes of debugging, I
would do:
NSLog(@"Is Kind of NSString: %@", [[step class] isKindOfClass:
[NSString class]] ? @"YA!" : @"NoWayMan");
But that's just me...
b.bum
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com