ios - app is crashing. when i'm downloading second index of video from custom table cell -
i'm developing app downloading video. it's working good.when i'm downloading first index video. when i'm downloading except video. it's crashing. error showing is:
'nsrangeexception', reason: '* -[__nsarraym objectatindex:]: index 1 beyond bounds [0 .. 0]'" *
-(void)clickbtn:(id)sender{ btntag =[sender tag]; nslog(@"%d",btntag); nslog(@"tag number = %ld",(long)[sender tag]); nsstring *vediourl =[[alldata objectatindex:btntag]valueforkey:@"video"]; nslog(@"%@",vediourl); nsstring *encodeurl = [vediourl stringbyaddingpercentescapesusingencoding: nsasciistringencoding]; nslog(@"%@",encodeurl); nsurl *url = [nsurl urlwithstring:encodeurl]; nslog(@"%@",url); self.downloadmanager = [[downloadmanager alloc] initwithdelegate:self]; self.downloadmanager.maxconcurrentdownloads = 4; [self.downloadmanager adddownloadwithfilename:downloadfilename url:url]; self.startdate = [nsdate date]; [self.downloadmanager start]; uibutton *button1 = (uibutton*)sender; nslog(@"%@",button1); cgpoint buttonposition = [sender convertpoint:cgpointzero toview:self.table]; nsindexpath *clickedip = [self.table indexpathforrowatpoint:buttonposition]; nslog(@"%@",clickedip); downloadcell *cell = (downloadcell *) [self.table cellforrowatindexpath:clickedip]; nslog(@"%@",cell); download *download = self.downloadmanager.downloads[clickedip.row]; nslog(@"%@",download); if (download.isdownloading) { [self updateprogressviewforindexpath:clickedip download:download]; } else { cell.progressview.hidden = yes; } }
you trying value array contain either 1 value @ 0 index
or particular array has been null. , when trying select second cell table-view
trying value array @ index 1
. in array there no value @ index 1
. why app going crashed.
please verify first using nslog array full fill according requirement or not.
Comments
Post a Comment