PROBLEM WITH ASSIGNING NSSTRING VALUE INTO UILABEL IN IPHONE

Lillian Martin

Total Post:27

Points:189
Posted by  Lillian Martin
 473  View(s)
Ratings:
Rate this:

I am new in iPhone app development so I have a problem with assigning string value into UILabel.
Code is here:

myLabel.text = [NSString stringWithFormat:@"%@", dataArr[row]];

the value of dataArr[row] is good - but myLabel variable appears as null.
How to solve this issue, please help me.!

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Problem with assigning NSString value into UILabel in iPhone

    I think your myLabel variable property is set like this:

    @property(nonatomic, weak)IBOutlet UILabel *myLabel;

    If you are defining property like that then you need to connect this to an actual UILabel in InterfaceBuilder.
    After that you will set the myLabel text using this code:

    self.myLabel.text = [NSString stringWithFormat:@"%@", self.dataArr[row]];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!