I'm passing a string in one class to a UILabel
in my view controller class. For some reason the string isn't being passed. when I check whats in the string it is 0x0
class.m
[[NSNotificationCenter defaultCenter] postNotificationName:@"notification"
object:self];
somestring = @"...";
ViewController.m
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleData:)
name:@"notification"
object:nil];
}
- (void)handleData:(NSNotification *)notification {
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
self.timerLabel.text =somestring;
}];
}