How to make multiline label on macOS by NSTextField?

Viewed 348

I can change label to multiline on IB, by setting Line Break Mode to Character Wrap, and the layout will auto change:

IB


But when I set it in code, there is still only one line:

self.label.maximumNumberOfLines = 5;
self.label.lineBreakMode = NSLineBreakByWordWrapping; 

How to change it by code?

0 Answers
Related