'sizeWithFont: restricinedToSize: lineBreakMode:' está en desuso:
Convertir un proyecto de iOS5.0 a iOS7 / iOS6 en Xcode 5. El siguiente código muestra una advertencia de tiempo de compilación:
'sizeWithFont: restricinedToSize: lineBreakMode:' está en desuso: primero en desuso en ios 7.0 - Use - boundingRectWithSize: opciones: atributos: contexto
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
self.lblHidden.frame = CGRectMake(58, 228, 945, 9999);
self.lblHidden.text = detailShareObj.pDesc;
CGSize size = [detailShareObj.pDesc sizeWithFont:self.lblHidden.font constrainedToSize:self.lblHidden.frame.size lineBreakMode:NSLineBreakByWordWrapping];
return 228.0+size.height+20;
}
else if (indexPath.section == 1)
{
NSString *tempPointStr = (self.shortDescArray)[indexPath.row];
self.lblHidden.frame = CGRectMake(58, 0, 945, 9999);
self.lblHidden.text = tempPointStr;
CGSize size = [tempPointStr sizeWithFont:self.lblHidden.font
constrainedToSize:self.lblHidden.frame.size
lineBreakMode:NSLineBreakByWordWrapping];
return 50.0f;
}
Intenté algunas de las sugerencias que se ofrecen en otros lugares, pero no se puede rescatar a nadie si alguien puede ayudar al dar las correcciones requeridas en el código.