Problem with "Multiple methods named ..."

I got a cork. I would like to implement UAModalpanelview for my project. It worked fine at first ... I implemented files ... whatever. But now I would like to run the application, but every time I received this error. It is because of the "center" that he shows me that "mutliple methods are called the center with an inconsistent result, parameter type, or attributes."

- (IBAction)showPopup:(id)sender { UAModalPanel *modalPanel = [[UAExampleModalPanel alloc] initWithFrame:self.view.bounds]; [self.view addSubview:modalPanel]; [modalPanel showFromPoint:[sender center]]; } 

Can anyone help me with this?

Thanks.

+4
source share
1 answer

It looks like you need to send the sender to an object type. I would suggest that this is a UIView.

 [modalPanel showFromPoint:[(UIView *)sender center]]; 

You can take a look at this similar question: Why am I getting the warning "Many methods named 'center' found"

+7
source

Source: https://habr.com/ru/post/1445814/


All Articles