ios - Tracking when a number of NSURLSessions have completed -
this has perplexed me time advice appreciated.
i have 10 nsurlsessionuploadtasks started @ same time , happening asynchronously viewdidload:
[self uploadmaininformation]; [self uploadsubinformation]; [self uploadlocation]; [self uploadmainphoto]; [self uploadsubphoto1]; [self uploadsubphoto2]; etc. using array when tasks complete using completion handlers. however, i'm stumped how poll array find out when empty. adding , removing @ start , end of each session start , end easy. have no idea how poll empty array.
is possible track when nsmutablearray empty? or there better solution of don't know , can't seem find? wish start 10 simultaneous uploads , know when have (successfully) completed.
thanks in advance assistance. it's driving me nuts.
why complicated array? add counter, simple int, increment when fire request , decrement when request finished or ran error. complete when value of counter 0.
anyway, nsarray empty when count method returns 0.
Comments
Post a Comment