我有一个问题。我想在我的项目中实现 UAModalpanelview 。起初它工作得很好...我实现了这些文件...无论如何。但现在我想运行该应用程序,但每次都会出现此错误。正是因为“中心”,它向我显示“发现多个名为中心的方法,其结果、参数类型或属性不匹配”。
- (IBAction)showPopup:(id)sender {
UAModalPanel *modalPanel = [[UAExampleModalPanel alloc] initWithFrame:self.view.bounds];
[self.view addSubview:modalPanel];
[modalPanel showFromPoint:[sender center]];
}
有人能帮我解决这个问题吗?
Thanks.
看起来您需要将发送者转换为对象类型。我假设它是一个 UIView。
[modalPanel showFromPoint:[(UIView *)sender center]];
你可以看看这个类似的问题:为什么我收到警告“找到多个名为‘center’的方法” https://stackoverflow.com/questions/11129778/why-am-i-am-getting-the-warning-multiple-methods-named-center-found
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)