CGSize textSize = CGSizeZero;

    if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0)

    {

        textSize = [text sizeWithAttributes: @{NSFontAttributeName:_numLabel.font}];

    }

    else

    {

#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wdeprecated-declarations"

        textSize = [text sizeWithFont:_numLabel.font];

#pragma clang diagnostic pop

    }

 

posted on 2015-05-22 11:51  童话DY  阅读(525)  评论(0编辑  收藏  举报