views:

45

answers:

1

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?

+1  A: 

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.

Jasarien
I had thought that this was the case, but wasn't 100% sure. Thanks.
Ardman