I have implemented the custom collection view using storyboard. and added a cross button and background image.
When collection view reloading that cross button have been hide for admin and shown for other members which is work perfectly first time.
I have set the tag btn.tag = indexpath.row and assign a function for remove user.
After removing the user and remove the object from the Array when reloading the collection view now that condition I have added for admin to hide button is not working and cross button displayed in all the cells of collection view.
Please anyone help.
if ([user.type isEqualToString:@"admin"])
{ [removeBtn setHidden:YES];
[removeBtn setEnabled:NO];
}else {
[removeBtn setHidden:NO];
[removeBtn setEnabled:YES]; }
Firsttime reloading the collection view result
After Remove Member reloading the collection view result
Debug Log After Press Remove Button but cross is now displayed in Admin Item Image.
2016-02-03 11:35:03.620 STT[32132:5629002] Col View 2usertype> admin
2016-02-03 11:35:03.620 STT[32132:5629002] Hide cross from Admin
2016-02-03 11:35:12.944 STT[32132:5629002] Col View 2usertype>
2016-02-03 11:35:12.944 STT[32132:5629002] Show cross for Mem
2016-02-03 11:35:17.799 STT[32132:5629002] Col View 2usertype> member
2016-02-03 11:35:17.800 STT[32132:5629002] Show cross for Mem