I have made a custom UITableViewCell in which I have added 2 labels and one UIImageView, each with IBOutlets.
IBOutlet weak var imageView: UIImageView!
I've given the UIImageView an IBOutlet named imageView
, but after adding it I am getting error:
Getter for 'imageView' with Objective-C selector 'imageView' conflicts with getter for 'imageView' from superclass 'UITableViewCell' with the same Objective-C selector"
How can I fix this error? Is there any way to use an IBOutlet named imageView
in a UITableViewCell subclass?
You are getting this error since UITableViewCell has its own imageView property and you are making an outlet of name imageView which will conflict with its super class(UITableViewCell) property name(imageView) which is a getter method. So, you just need to change the name of the outlet.
Change the name of the outlet as everyone is suggesting, as tableviewCell has its own imageView
property, so when you are assigning another outlet with the name of imageView
the getter methods are getting conflicted
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With