Daniella D'Cruz Daniella D'Cruz - 4 years ago 162
Objective-C Question

Invalid operands to binary expression ('CGFloat' (aka 'double') and 'UIView * _Nullable')

Hi i am getting the following error while converting from swift to objective c code. Please see the screenshot.

enter image description here

enter image description here

Answer Source

As Mike Taverne commented, the ! needs to go. Insead of !. I think you probably want -> if the is supposed to be objective C. ObjC seems to think you want to subtract _profileBelowView.superView from offsetY. You could try putting parentheses around the second half of the subtraction. That's not the real problem here but you might have gotten a better error message once the order of operations issue was removed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download