Perform Method on Main Thread Issue
Hi I am trying to call a method from another subclass and it is working
but not being displayed on the main screen. The log shows that the method
is working but more than likely on a new instance of my controller.
Here is the method in my ViewController Class
//.h
{
- (void)updateCells;
}
//.m
- (void)updateCells
{
//Code in here
}
And in the method from another subclass that calls the method:
ViewController *viewController = [[ViewController alloc] init];
dispatch_async(dispatch_get_main_queue(), ^{
[viewController updateCells];
});
I tried the dispatch_async to have it perform the updateCells on the
screen but the method is called and nothing inside it is displayed. Should
I not create a new viewController instance and if so what should I do
instead? Thanks I am new to how calling methods from different classes
works.
No comments:
Post a Comment