If you want to check an object if it belongs to a specific class (at runtime), use this:
if ([myObj isKindOfClass:[NSString class]]) { ... }
Your question is not entirely clear, it seems that your best option is to make the "string stored in the object" another property of the NSString type, so you do not have to do any clicks and type checks at all.
source
share