Multiple methods named ‘layer‘ found with mismatched result, parameter type or attributes

ゝ一世哀愁。 2024-05-03 14:42 114阅读 0赞

问题:

Multiple methods named ‘xxx’ found with mismatched result, parameter type or attributes

出现问题的原因就是,你这个方法中的“xxx”,在不同方法中出现了,他们同名冲突了,系统不知道要去执行哪个文件下面的“xxx”方法。所以你要告诉系统,你去执行哪个文件下面的方法,举例说明:

原来的代码:

CALayer *layer2 = [whitchController1 layer];

layer2.borderColor = [controllerColor CGColor];

layer2.borderWidth = 0.2f;

修改后的代码:

CALayer *layer2 = [(UIView *)whitchController layer];

layer2.borderColor = [controllerColor CGColor];

layer2.borderWidth = 0.2f;

这就是告诉系统,执行(UIView *)下面的layer。

发表评论

表情:
评论列表 (有 0 条评论,114人围观)

还没有评论,来说两句吧...

相关阅读