In my project am downloading data from server, downloading code is in App Delegate.m file and once am passing downloading status(in bytes) to NSNotification object. In my ViewController am trying to update UIProgressView using the above downloading status. When i log Downlaoding status (bytes downloaded) am getting correct value. But when i tried to show that in UIProgressView and its not showing anything.
Code
App delegate.m
ViewController *viewC=[[ViewController alloc]init];
[viewC postNotificationWithValue:bytesDownloaded:totalSize];
In ViewController.m
- (void)viewDidLoad
{
_progreeView.progress = 0.0; //UIProgressView
NSString *notificationName = @"MTPostNotificationTut";
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(useNotificationWithString:)
name:notificationName
object:nil];
}
- (void)postNotificationWithString:(NSUInteger )current:(NSUInteger )total {
// NSLog(@"%f",(double)current/(double)total);
float status=(double)current/(double)total;
_downloadStatus.text=[NSString stringWithFormat:@"%f",status];
[_progreeView setProgress:status animated:YES];
}
and my UIProgressbar is not updating at all. Pls help me