'-[__NSDictionaryI length]: unrecognized selector sent to instance' - trying to figure out why

前端 未结 4 1524
别跟我提以往
别跟我提以往 2021-01-13 08:08

I\'ve a UITableView with custom UILabel for title and one another to subtitle, in order to align the text to right.

My data come from web s

4条回答
  •  情歌与酒
    2021-01-13 09:02

    Reason: NSDictionary doesn't have lengh method but NSString has

    Change this line

        if (imageUrl.length > 0)
        {
    

    To

        if ([imageUrl isKindOfClass:[NSString class]] && imageUrl.length > 0)
        {
    

提交回复
热议问题