ios - UITableViewCell Containing A Custom View with UICollectionView in it -


i have customview xib , view contains uicollectionview in it. add custom view inside uitableviewcell in uiviewcontroller. uiviewcontroller create array of arrays different length fill uicollectionviewcell. im not having desired result. uitableview after third array repeats 3 first arrays here sample of arrays in uiviewcontrollers viewdidload:

array1= [nsarray arraywithobjects:zeroitem, seventhitem, nil]; array2= [nsarray arraywithobjects:thirditem,forthitem,nil]; array3= [nsarray arraywithobjects:fifthitem,sixthitem, nil]; array4= [nsarray arraywithobjects:eighthitem,seventhitem, nil]; array5= [nsarray arraywithobjects:forthitem,zeroitem, nil]; 

and fill main array in lazy instantiation:

-(nsmutablearray *)arraystack {     if (!_arraystack) {         _arraystack = [[nsmutablearray alloc] init];          [_arraystack addobject:array1];          [_arraystack addobject:array2];          [_arraystack addobject:array3];          [_arraystack addobject:array4];          [_arraystack addobject:array5];             }     return _arraystack; } 

and here datasource of uitableview fill uicollectionviewcell arrays:

- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {      return [self.arraystack count]; }  - (ffstackcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     ffstackcell * cell = [tableview dequeuereusablecellwithidentifier:@"ffstackcell" forindexpath:indexpath];      cell.thecustomview.stackofvideos = self.arraystack[indexpath.row];     cell.thetitle.text = [nsstring stringwithformat:@"stack %ld",(long)indexpath.row+1];      return cell; } 

the problem here after array3 arrays repeat , array4 , array5 not appear. mixing delegate of uitableview in uiviewcontroller , uicollectionview in customview creating. please give me suggestion. in advance.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -