UILabel:

 

- (void)viewDidLoad

{

    [super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

    NSString *str=@"i am a string";

    

    UIFont *_font=[UIFont fontWithName:@"Arial" size:50.0f];

    

    CGSize labesize=[str sizeWithFont:_font];

    

    UILabel *_label=[[UILabel alloc]init];

    _label.text=str;

    _label.font=_font;

    _label.frame=CGRectMake(0, 0, labesize.width, labesize.height);

    

    [self.view addSubview:_label];

    [_label release];


}


 

 

run result: