I'm trying to make this method a generic datatype verification
method. Any ideas how to make this work?
Thanks again,
-- Tito
On 30/06/2005, at 23:54, Sherm Pendley wrote:
On Jun 30, 2005, at 11:42 PM, Tito Ciuro wrote:
A method receives an object of type id. I want to make sure that
the object is a string, so I'm using isKindOfClass. The problem is
that sometimes the object is a NSConstantString and other times a
NSCFString, so when the object passed is NSConstantString,
isKindOfClass returns NO. Since both objects are strings, what
test/comparison would return YES?
Both of those should descend from NSString, so I'd try:
if ([aString isKindOfClass:[NSString class]]) {
// Yep, it's a string
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden