views:

207

answers:

1

I am trying to set some text on a label

descriptionLabel.text = [NSString stringWithFormat:mySTUser.bio];

The bio property of mySTUser is an NSString. Sometimes it is not an NSString when I set it. How can I check if mySTUser.bio is an NSString so I can prevent it from being assigned to my label text?

+1  A: 
if (![mySTUser.bio isKindOfClass:[NSString class]]) {
    // its not an NSString
}
macatomy
Thanks for the tip. This works perfectly.
Sheehan Alam