I have a function perform_function. I want to perform it 1000 times. I would usually write a for-loop to do this e.g. ;
for(int i=0; i<1000; i++)
{
[self perform_function];
}
But i want the function to finish before iterating to the next integer so it’s asyncronous. How could i do this?
Try using
dispatch_async, which will let you execute code in the background: