值未从Tableview传递到collectionview

时间:2014-08-23 06:58:55

标签: ipad uicollectionview swrevealviewcontroller

我使用SwReveal视图控制器将值从表视图传递到集合视图控制器。当我在集合视图中单击一个单元格时,我存储了集合视图单元格的索引路径。但是当我选择一个表并将值传递给索引路径集合视图时。单元格未显示该值。它是null ...这是我的代码

-(void)viewWillAppear:(BOOL)animated{
    text=seltext;
    NSLog(@"text %@",text);

 **// HERE I AM GETTING VALUES FROM TABLE VIEW CONTROLLER**

    self.displayindex=Viewindex;
    NSLog(@"self dispaly %@",Viewindex);

  **// HERE I AM GETTING INDEX PATH OF SELECTED COLLECTION CELL**

    Cell *cells = (Cell *)[collectionData cellForItemAtIndexPath: self.displayindex];
    cells.subjectLabel.text=@"djhfkjdshfjkhd";
    cells.cellView.backgroundColor=[UIColor greenColor];
    NSLog(@"cell is %@",cells);
    NSLog(@"text %@",text);

**// CELL IS NULL HERE AND NOTHING IS DISPLAYING EVEN IF I PASS THE CELL FRO ITEM INDEXPATH**

        }

0 个答案:

没有答案