开发者

How to check if variable is a CFString?

开发者 https://www.devze.com 2022-12-25 21:15 出处:网络
I am trying to set some text on a label descriptionLabel.text = [NSString stringWithFormat:mySTUser.bio];

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?


if (![mySTUser.bio isKindOfClass:[NSString class]]) {
    // its not an NSString
}
0

精彩评论

暂无评论...
验证码 换一张
取 消