问题
I got a probelm. I would like to implement the UAModalpanelview to my project. At first it worked fine...I implemented the files...whatever. But now I would like to run the application, but I got this error every time. It is because of the "center" it shows me that "Mutliple methods named center found with mismatched 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]];
}
Could anyone help me with this?
Thanks.
回答1:
Looks like you need to cast sender to an object type. I would assume it is a UIView.
[modalPanel showFromPoint:[(UIView *)sender center]];
You can take a look at this similar question: Why am I am getting the warning "Multiple methods named 'center' found"
来源:https://stackoverflow.com/questions/13364891/issue-with-multiple-methods-named