ARC or no?
if you have a crash, post the backtrace
surrounding a
performInBackground:...
call with an@autoreleasepool
does nothing (NSAutoreleasePool
isn't going to help, either -- you need the autorelease pool to be in the thread of execution)if a variable is involved in a crash, show the variable's declaration and initialization
spawning a bunch of threads simultaneously to do a bunch of work is likely to be slower than doing the work sequentially. Concurrency should always be controlled. If you have a long running task, you might likely want to spin up a second thread. Or you might want to re-order operations. The issue, though, is that running multiple threads at once, especially if those threads are doing a lot of I/O, is just going to increase contention and may likely make things slower, often a lot slower.
More likely than not, one of the objects calculated on a background thread is being released before the main thread tries to use it. How do you ensure that resultDupPhotos
is valid between threads?