You may want to consider changing the comparison to:

`[attributes.indexPath compare:item.indexPath] == NSOrderedSame && attributes.representedElementCategory == item.representedElementCategory`