OC过期方法/属性替换汇总
1.sizeWithFont.(iOS7.0废除) - > sizeWithAttributes
(1) CGSize size = CGSizeZero;
size = [title sizeWithFont:[UIFont systemFontOfSize:15]]; -->
size = [title sizeWithAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]}];
(2)CGSize size =[value sizeWithFont:[UIFont systemFontOfSize:fontSize] constrainedToSize:CGSizeMake(CGFLOAT_MAX,height) lineBreakMode:NSLineBreakByWordWrapping]; -->
NSAttributedString *attributedText =[[NSAttributedString alloc] initWithString:value attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]}];
CGRect rect = [attributedText boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height)
options:NSStringDrawingUsesLineFragmentOrigin
context:nil];
CGSize size = rect.size;
2.label.lineBreakMode = UILineBreakModeWordWrap; (iOS6.0废除)-->
label.lineBreakMode = NSLineBreakByWordWrapping;