iPhone check firmware version

前端 未结 3 676
时光取名叫无心
时光取名叫无心 2020-12-29 00:51

HI all

I want to make one app for iPhone 2.2.* and for version 3.0. Some method in 2.2* is deprecated in 3.0. ( like UITableViewCell setText and setLabel )

I

3条回答
  •  隐瞒了意图╮
    2020-12-29 01:09

    Alternate solution, just check using respondsToSelector. For example-

    CGSize expectedLabelSize;
        if ([subTitle respondsToSelector:@selector(sizeWithAttributes:)])
        {
            expectedLabelSize = [subTitle sizeWithAttributes:@{NSFontAttributeName:subTitleLabel.font}];
        }else{
            expectedLabelSize = [subTitle sizeWithFont:subTitleLabel.font constrainedToSize:subTitleLabel.frame.size lineBreakMode:NSLineBreakByWordWrapping];
        }
    

提交回复
热议问题