null - UILabel is not getting created when the app loads for first time- IOS -


I have a problem in which the UILB has not been assigned with text, when the app loads the app load After the app loads the app loads for the first time and is called again several times (which will provide two different labels). There are two methods updateDateLabel and updateTitleLabel On user request

  - (zero) update database {NSDateFormatter * outputFormatter = [[NSDateFormatter alloc] init]; OutputFormatter.dateFormat = @ "HH: mm MM-dd-YY"; _dateLabel.text = [NSString stringWithFormat: @ "as:% @", [outputFormatter stringFromDate: _refreshDateTime]]; [_dateLabel SatanAIDSDisplay];  

}

  - (zero) update based on the label {_selectedProfileData = [_balanceData ObjectOutIndex: Selected Profiles]; If ([NSNull null]! = [_selectedProfileData objectForKey: @ "advprofileName"]) {NSString * name = [_selectedProfileData objectForKey: @ "advprofileName"]; _titleLabel.text = [NSString stringWithFormat: @ "balance of% @", name]; [_title label setNewsDisplay]; } Else {_titleLabel.text = @ "QuickView Balance"; [_title label setNewsDisplay]; }  

}

The thing is that the balance as QuickView: should be displayed when the app loads for the first time, but What's happening is that it displays the balance of (null): (empty)

My guess is that when these methods are called for the first time, then not the labels Are being made, can anyone help me with it? Thank you

Your [_ selectedProfileData objectForKey: @ "advprofileName"] is zero . Check with

  NSLog (@ "% @", [_selectedProfileData objectForKey: @ "advprofileName"]);  

You will see (null) .

or just

if your value is zero, then

  for testing ([_ selectedProfileData objectForKey: @ "advprofileName"] = zero )    

You do not need to call setNeedsDisplay and if you see something on the screen, the labels are created.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -