-3

I want to add a second line to my UILabel but I have no idea where to put the code and I am stuck without it. #import

@interface ViewController : UIViewController{

IBOutlet UITextField *TramNumber;
IBOutlet UILabel *Tramresult;



}
- (IBAction)Button:(id)sender;
- (IBAction)DismissKeyboard;



@end

This is the code in my ViewController.h, Tramresult is my UILabel.

needshelp
  • 595
  • 1
  • 6
  • 25
  • 2
    A small comment, properties and methods should not start with a capital letter. Second you want to set the `numberOfLines` of your [`UILabel`](https://developer.apple.com/library/ios/documentation/Uikit/reference/UILabel_Class/index.html) to 2 for to lines or 0 for unlimited lines. – rckoenes Oct 14 '14 at 09:43
  • And the setting of this can occur in the XIB -- it doesn't have to be dynamic. – Hot Licks Oct 14 '14 at 11:29

1 Answers1

2

You can do it in Interface builder (probably best for you), or in any place of code. In that case the best place will be ViewDidLoad:

- (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [Tramresult setNumberOfLines:0];  
}
Reconquistador
  • 885
  • 8
  • 28