问题"多个方法命名...."

Mas*_*zer 4 iphone objective-c popup ios

我有一个问题.我想将UAModalpanelview实现到我的项目中.起初它工作得很好......我实现了文件......无论如何.但是现在我想运行应用程序,但每次都会出现此错误.正是由于"中心",它向我展示了"多重方法命名中心找到了不匹配的结果,参数类型或属性".

- (IBAction)showPopup:(id)sender {

    UAModalPanel *modalPanel = [[UAExampleModalPanel alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:modalPanel];
    [modalPanel showFromPoint:[sender center]];
}
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我这个吗?

谢谢.

Bri*_*ian 7

看起来您需要将发件人转换为对象类型.我认为这是一个UIView.

[modalPanel showFromPoint:[(UIView *)sender center]];
Run Code Online (Sandbox Code Playgroud)

您可以看看这个类似的问题: 为什么我收到警告"找到多个名为'center'的方法"