iphone - Header view not working class registering error, UICollectionView -


i trying show header on uicollectionview class not getting registered. below code.

- (uicollectionreusableview *)collectionview:(uicollectionview *)collectionview viewforsupplementaryelementofkind:(nsstring *)kind atindexpath:(nsindexpath *)indexpath {     nsstring *identifier = nil;      if ([kind isequaltostring:uicollectionelementkindsectionheader]) {         identifier = @"header";     }      uicollectionreusableview *supplementaryview = [self.collectionview dequeuereusablesupplementaryviewofkind:uicollectionelementkindsectionheader withreuseidentifier:@"header" forindexpath:indexpath];      return supplementaryview; }  //  registering class in viewdidload  [self.collectionview registerclass:[uicollectionreusableview class] forsupplementaryviewofkind:uicollectionelementkindsectionheader withreuseidentifier:@"header"]; 

one thing tell have not created other class or view controller, registering uicollectionreusableview, same way registered uicollectionview class, works, don't know why giving same error every time. wanted display image put on cell no sub classing done. did

[self.collectionview registerclass:[uicollectionviewcell class] forcellwithreuseidentifier:@"cell"]; 

similarly tried header. error got every time is:

uicollectionelementkindsectionheader identifier test header view - must register nib or class identifier or connect prototype cell in storyboard' 

please guide in not getting error, spend 2 days on it. missing not getting. please guide.

it looks you're looking uicollectionelementkindsection**footer** registered uicollectionelementkindsection**header**


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -