I try to add a new cell in my UIcollectionView but it doesn't work. In fact I send a post request to my API, I wait for the response, when I get the response, I put de JSON content into an NSDictionnary.
My CellForItemAtIndexPath Datasource method loads cell content from an array called "formationsData", so when I get the response, I add my NSDictionnary into this array.
In numberOfItemAtIndexPath I return something like : [self.formationData count].
Here is my code when I post my request :
NSDictionary * response = [responseJSON valueForKey:@"formation"];
[(NSMutableArray *)_formationsView.carousel.formationsData addObject:response];
[_formationsView.carousel insertItemsAtIndexPaths:@[[NSIndexPath indexPathForItem: _lastRowIndex-1 inSection:0]]]; //insert at index : last row - 1
//[_formationsView.carousel reloadData]
Before I was using reloadData but my app crash when I do that.
My problem :