Re: Checking the type...
Re: Checking the type...
- Subject: Re: Checking the type...
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 13 Mar 2003 19:51:11 -0800
On Thursday, March 13, 2003, at 07:39 PM, Hussain Bandukwala wrote:
I have entries of various types (NSString, etc.) in an NSMutableArray
and was wondering if there is a way to check for these types. I would
like to perform different functions on the entries if they are of the
NSString type and different functions if they are of some other type.
Could someone please tell me what method(s) to use for checking for
the NSString type?
Use "-isKindOfClass" and "+class" to do this. For example, given a
class named "class":
if ([class isKindOfClass:[NSString class]] == YES)
{
// if your code gets to this point, then class is an NSString or
inherits from NSString
}
Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page:
http://dreamless.home.attbi.com/
Smile! It confuses people!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.