objective c - NSOperation Queue executes only first operation and stop executing after that -
i trying execute custom operations in nsoperation queue, problem executes first operation in queue , not execute rest of them. please resolve issue.
here code:
for (contentmediamodel *uploadmedia in mediaarray) { amazonupload *customoperation = [[amazonupload alloc] initwithdata:uploadmedia]; [operationqueue addoperation:customoperation]; }
here custom operation class:
@implementation amazonupload -(amazonupload *)initwithdata:(contentmediamodel *)uploadmedia { if (self = [super init]) { self.uploadmedia=uploadmedia; executing = yes; finished = no; } return self; } -(void)start { nslog(@"** operation starts **"); [self main]; } -(void)main { if ([self iscancelled]) { nslog(@"** operation cancelled **"); } nslog(@"** operation executing **"); [[amazons3manager sharedinstance] uploadfile:self.uploadmedia.media.filename showloader:no]; } -(bool)isconcurrent { return yes; } -(bool)isexecuting { return executing; } -(bool)isfinished { return finished; } @end
Comments
Post a Comment