How to implement a NSProgressIndicator in a non void function

How can I implement a NSProgressIndicator in a non void function?

This is not supported in a non void function, what can I do?

dispatchasync(  dispatchgetglobalqueue(DISPATCHQUEUEPRIORITYDEFAULT, 0),
  dispatch
async(dispatchgetmain_queue(), ^{

            [myProgressBar setUsesThreadedAnimation:YES];
[myProgressBar setHidden:FALSE];
[myProgressBar setDoubleValue:15.0];
[myProgressBar startAnimation:myProgressBar];
});
  }); 

any help is very appreciated.
Answered by MacDev001 in 654191022
I found another question on this forum, which solves my issue:

[[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];

Posted 4 years ago by lemonmojo 
Accepted Answer
I found another question on this forum, which solves my issue:

[[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];

Posted 4 years ago by lemonmojo 
How to implement a NSProgressIndicator in a non void function
 
 
Q