vendredi 22 juillet 2016

UICollectionView how to reloadData from delegate

I am trying to reload my collectionView from my delegate method "applicationDidEnterForeground" but i got an error ""UICollectionView must be initialized with a non-nil layout parameter"

in my CollectionViewController I have this method

-(void)reloadThisData
{
    [self.collectionView reloadData];
}

and here is my code in the appDelegate

- (void)applicationWillEnterForeground:(UIApplication *)application {
    CollectionViewController *collectionViews = [[CollectionViewController alloc]init];

    [collectionViews reloadThisData];
}

i know that it will only create another collectionView that is why it will only return a null value. is there any other way to reload my uiviewcollection from background to foreground?

Aucun commentaire:

Enregistrer un commentaire