I am getting the text size of a string with this
textSize = [[tempDict valueForKeyPath:@\"caption.text\"] sizeWithFont:[UIFont systemFontOfSize:12] constrain
Please, see this answer How to get NSString size when NSString includes emojis?
If you have only emojis then you shouldn't use sizeWithFont. Use label for it or something else.
NSString doesn't work with Emojis, only text. If you have emojis, then you should use [label sizeToFit] or [label sizeThatFits:]
Also, you can use this code:
id text = [tempDict valueForKeyPath:@"caption.text"]
if (![text isKindOfClass:[NSNull class]]) {
...
}
Because, you get NSNull from dictionary, but it doesn't equal nil, and your condition works.