I have applied a custombadge as a subview of a UIButton with the help of @Midhun MP in this question - Adding a subview to UIButton.
All works great - but I'm now trying to remove the subview when the button is clicked.
I've setup a method thats triggered via a click on one of the buttons
- (void)hide
{
//Hide Buttons
_importantMsg.hidden = YES;
[CustomBadge removeFromSuperview];
}
But I'm struggling to hide the subview - I've tried -
[CustomBadge removeFromSuperview];
and
_MsgHeadBtn.subviews.hidden = YES;;
but i get unknown receiver errors - can anyone point me in thh right direction pls?
errors for each try show in screenshot below -