Issue with “Multiple methods named…”

◇◆丶佛笑我妖孽 提交于 2019-12-10 17:09:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!