objective c - How to stop execution of for loop in middle in ios -


hi in application have 2 types of syncs. 1.auto sync 2.manual sync. in both syncs downloding bunch of files server. if choose auto sync files download.

code

for(int i=0;i<filescount;i++) {  [self downloadfiles];  }  -(void)download files {    //here creating `nsinvocationoperation`.        if(!synchingfilecount)          totalreceiveddata=0; } 

based on totalreceiveddata updating progress bar. issue if autosync working fine.while downloading files using autosync , in middle if click manual sync time [self downloadfiles]; method called issue synchingfilescount not updating it's completeing autosyncfiles download , synchingfilescount become 0 due reason totalreceiveddata become 0 , progress bar disappearing. after complete opertiona again synchingfilecount becomes 4 cannot able see progress bar due above situation. please 1 me how can come out situation.

ok, if understand question correctly, sounds need create flags can manage flow of code. can making boolean property , setting need in completion block of these sync methods. way can call method or execute method after call complete.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -