What I want to do is have a while statement which loops whilst the recorder.recording property value is set to YES. So, something like:
while (recorder.recording == YES)
{
// Do something here until the record button is pressed again
// Stop the recorder from recording and break out of loop
}
Problem I’m currently facing is that the UI becomes completely frozen due to the while loop. Any ideas?
Either use an NSTimer to perform the action at a given time interval while the recorder is recording or look into using a separate thread to do your loop work on.
Tight loops like this will block the UI if done on the main thread, because that’s where the UI is running.