objective c - NSOperationQueue operation priority -



objective c - NSOperationQueue operation priority -

i have problem operations. when add together operations nsoperationqueue , it's had executed have method add together array result. method:

- (void)loadpostimagewithdictionary:(nsdictionary*)dict { nsdata *tmpimagedata = [[nsdata alloc] initwithcontentsofurl: [nsurl urlwithstring: [dict objectforkey:@"picture"]]]; uiimage *image=[[uiimage alloc] initwithdata:tmpimagedata]; [userpostimage addobject:image]; [image release]; }

and if operation have executed - result adding array. need operations performed in order of added them. please help..

use [nsoperationqueue setmaxconcurrentoperationcount:1] method allow 1 operation run @ time, making serial queue on thread.

if code depends on operations running in specific order (which, in multithreading, isn't design in first place), when why don't pass array of dictionaries single operation, downloads images , returns array of images in delegate method?

objective-c cocoa-touch nsoperationqueue

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -