views:

245

answers:

1

Recently I use NSTimer to repeat taking photos, it'll show on the screen.

This is the problem:

I need to execute my app. & taking photos at the same time. So, does there any way to take photos at background?

I'll appreciate for any opinions~

A: 

Look into NSThread's detachNewThreadSelector:toTarget:withObject: method.

For example:

[NSThread detachNewThreadSelector:@selector(takePictures) toTarget:self withObject:nil];

Somewhere else in your class, you'd have:

- (void) takePictures {
   // insert code to take pictures...
}
Alex Reynolds
thanks a lot,I'll try if it works~