For example, when I call a method that returns a value, but it doesnβt interest me at all, can I safely ignore it?
An example, not:
CGSize size = [str sizeWithFont:myFont minFontSize:19.0f actualFontSize:&actualFontSize forWidth:150.0f lineBreakMode:UILineBreakModeClip];
... do the following:
[str sizeWithFont:myFont minFontSize:19.0f actualFontSize:&actualFontSize forWidth:150.0f lineBreakMode:UILineBreakModeClip]
I do not need CGSize size, but only actualFontSizethat is transmitted by reference. Now the problem is that Xcode gives me a warning if I don't read size. I do not want to suppress these warnings, and at the same time I do not want them at all.
So I'm wondering if this is good if I just don't assign the return value to anyone?
source
share