In my connection DidReceiveData method I have an NSLog that prints the percentage data received and it is working well. I need to display this percentage on a UILabel but the UILabel is not getting updated. I am able to update the UILabel from other methods like viewDidLoad or by pressing a button. But from the connection did receive data I am not getting any change. What could be the catch here. There is nothing wrong with my Label, and my calculations. Does this method get run in the background or something.
In my connection DidReceiveData method I have an NSLog that prints the percentage data
Share
Assuming you haven’t done anything funky to make that run on a background queue/thread (it should be main queue/thread by default), there are a couple possibilities that come to mind:
The method is getting called before your view is actually set up. This could certainly happen in certain circumstances where you kick off network activity before you set up the UI.
The actual
UILabelisn’t wired up correctly, though this seems unlikely if things work in-viewDidLoad.To test, break in the method and
po myLabelto make sure it’s not nil.