0

In my project, which exists for some years now there is a piece of code which is deprecated. I know, I should have taken care of it a long time ago, but I didn't (shame on me). See the my used code below:

// Tell the label to use an unlimited number of lines
[discLabel setNumberOfLines:0];
[discLabel setBackgroundColor:[UIColor clearColor]];
[discLabel setFont:[UIFont systemFontOfSize:15]];
discLabel.textColor = [UIColor colorWithRed:255 green:255 blue:255 alpha:1.0];

CGSize infoLabelSize = [infoLabel.text sizeWithFont:infoLabel.font
                                constrainedToSize:CGSizeMake(infoScroll.frame.size.width, 5000)
                                      lineBreakMode:NSLineBreakByWordWrapping];

infoLabel.frame = CGRectMake(0, 0, infoLabelSize.width, infoLabelSize.height);
infoScroll.contentSize = infoLabelSize;

[infoScroll addSubview:infoLabel];

[self.view addSubview:infoScroll];

The developer site tells me to use boundingRectWithSize but I simply can't get it reworked. It is a piece of information what was shown in a scrollable textarea on a flipsideViewController. Any suggestions?

EDIT: I added some of my code to show all of it concerning the discLabel

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
A3O
  • 513
  • 12
  • 29
  • Hi all, I'm trying to get it under my skull with no success yet. I simply don't understand it. I'm a fairly new to it and English is not my native. Is it possible that anyone takes me under hers / his wings in this matter? I'm totally lost. So I need help, even when it looks like a duplicate question. What do I have to do? – A3O Aug 10 '17 at 17:21
  • You should use the `boundedRectWithSize:` method of NSString, as described in the accepted answer of the duplicated question. – fishinear Aug 10 '17 at 18:37
  • @fishinear, I was able to solve the SIGABRT error, it was caused by the update to Xcode 8.3.3. However I'm still stuck on the deprecated code. Somehow I don't get it under my skull. Would you be so kind to help me bit further. And yes, I read and tried to understand the accepted answer but I can't get it right..... stupid me. – A3O Aug 12 '17 at 07:30
  • I've edited my question by adding som of the code. – A3O Aug 12 '17 at 07:34

0 Answers0