ios - cellForItemAtIndexPath: is not called when using custom UICollectionViewLayout subclass -


when using custom uicollectionviewlayout subclass, cellforitematindexpath: not called (i checked using breakpoints , debug output). how use custom layout:

- (void)viewdidload     {         [super viewdidload];          dmsgridlayout* gridlayout = [[dmsgridlayout alloc] init];  //      uicollectionviewflowlayout* flow = [[uicollectionviewflowlayout alloc] init]; //      [flow setitemsize:cgsizemake(150, 150)];          uicollectionview *collection = [[uicollectionview alloc] initwithframe:self.view.bounds collectionviewlayout:gridlayout];         collection.delegate = self;         collection.datasource = self;         self.collectionview = collection;          [self.view addsubview:self.collectionview];         [self.collectionview registerclass:[dmsgridcell class] forcellwithreuseidentifier:@"collectioncell"];     } 

but when change above code use uicollectionviewflowlayout instead of custom subclass, cellforitematindexpath: called.

could code custom layout subclass prevents cellforitematindexpath being called?

if layout doesn't return size collection view, example, or size layout objects, cell never created. also, frames in layout objects have within visible area of collection view.


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -