label.position = CGPointMake(self.size.width*0.125, self.size.height-CGFloat(0.15)*self.size.height*_activeEnemiesArray.count)
I get an error pointing to self.size.width that says
'CGFloat' is not convertible to 'Double'.
This makes sense, since a CGFloat value and a Double value cannot be multiplied, but then when I convert the 0.125 to CGFloat:
label.position = CGPointMake(self.size.width*CGFloat(0.125), self.size.height-0.15*self.size.height*_activeEnemiesArray.count)
I get an error pointing to self.size.width that says
'CGFloat' is not convertible to 'UInt8'
This does not make any sense. Has anyone else been experiencing this and what could be the cause?
Xcode is leading you astray -- literals shouldn't really ever cause problems, as they'll get converted into
DoubleorCGFloatas needed once everything else is the same type. Instead, what's going on is that you have anIntat the very end of your line:That
countproperty needs to be converted toCGFloatso it can be used with the rest: