Janak Janak - 9 days ago 5
Objective-C Question

Multiple methods named 'setCornerRadius:' found with mismatched result, parameter type or attributes

I get this error when i try to set the corner radius of a segment

[[self.daysSegment.subviews objectAtIndex:cnt] setCornerRadius:0];



Multiple methods named 'setCornerRadius:' found with mismatched result, parameter type or attributes


Thank You

Answer

Try this -

[[(UIView*)[self.daysSegment.subviews objectAtIndex:cnt] layer] setCornerRadius:0];

Edit

I will suggest you to break above code. It will make debugging much easier.

UIView  *view  = [self.daysSegment.subviews objectAtIndex:cnt];
CALayer *layer = [view layer];
layer.cornerRadius = 0.0;
Comments