This is a big problem. So far, I have decided to use some temporary fixed size buffers and disconnect the stream for each buffer when it is full. The stream will store the contents of the buffer in flash memory. The launch of some heavy threads, heavy beacause, each stream of access to the flash will slow down the device and update the look of the camera. Buffers cannot be large because you get a memory warning and cannot be small because you will freeze the device due to too many threads and accessing flash memory at a time. The solution is in the balancing buffer size and the number of threads.
I have not tried using sqlite3 db yet to store binary image data, but I wonβt if it would be a better solution.
PS: speed up the method call of the class, avoid the general solution [object method] because of how the method call works, but try to get and save the method address, as shown below.
From Apple ObjC doc:
"The example below shows how a procedure that implements the setFilled: method is called:
void (*setter)(id, SEL, BOOL); int i; setter = (void (*)(id, SEL, BOOL))[target methodForSelector:@selector(setFilled:)]; for ( i = 0; i < 1000, i++ ) setter(targetList[i], @selector(setFilled:), YES); "
Marco
source share