OK, im using the sizeWithFont: constrainedToSize capability, and I'm getting a compiler warning. I've read that I need to use sizeWithAttributes instead (link here: Replacement for deprecated sizeWithFont: in iOS 7?).
I'm having a very hard time understanding how to implement sizeWithAttributes dynamically, so that the height of my cell row changes to the content height (please see below).
Any ideas on how to get rid of this warning? Thanks!
int topPadding = cell.menuItemTitle.frame.origin.x;
int bottomPadding = cell.frame.size.height-
(topPadding+cell.menuItemTitle.frame.size.height);
NSString *text = [[menuItems objectAtIndex:indexPath.row] valueForKey:@"title"];
CGSize maximumSize = CGSizeMake(cell.menuItemTitle.frame.size.width, 9999);
CGSize expectedSize = [text sizeWithFont:cell.menuItemTitle.font
constrainedToSize:maximumSize lineBreakMode:cell.menuItemTitle.lineBreakMode];
return topPadding+expectedSize.height+bottomPadding;