I want to fire off a method and have it run in the background - I do not care what really happens to it after it is started.
So in my main viewDidLoadMethod I have all o
First, you should name the queue using reverse domain syntax, eg "com.foo.myapp.backgroundwork" - this ensures uniqueness and consistency.
Second, you are immediately trying to release the queue you just created (and is presumably doing some work). Don't do that. Release the queue after work is done instead. The following is actually documented in the Concurrency programming guide, under "managing queue memory"
dispatch_async(newImages, ^{
[self getNewImages];
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_release(newImages); //this executes on main thread
});
});
edit: After re-reading the concurrency guide myself (I take my own medicine), I learned that the runtime will actually clean up a dispatch_queue that reaches 0 reference count on a background thread, so that shouldn't block your UI. It's still a bad idea to release it immediately, and instead follow the practice I demonstrated, where your task queues up it's cleanup on the main thread. So, in hindsight I'm thinking that your -getNewImages
method might be responsible for blocking your UI. Can you show some code from that method so we can rule that out?