BCE0019: is not a member of 'UnityEngine.Component' when trying to Build and Run iOS Unity

I've read through some forums, and I know the issue is related to Unity iPhone not supporting dynamic typing, but I still can't manage to get the syntax right on this one. Below is the syntax that works in standard Unity.

-- here is a snip of code, where I'm trying to test if the int "idNumber" is the same as the int "idNumber" on the object a ray is hitting where "hit" is the Raycast and "touchingThreeScore" is the name of the script attached to (and that has the variable idNumber) and the transform that is held in thisTransform

if(hit.collider.gameObject.GetComponent(touchingThreeScore).idNumber == thisTransform.GetComponent(touchingThreeScore).idNumber){ Debug.Log("You're Amazing for helping me out!!!");}

if ( (hit.collider.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber == 
     (thisTransform.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber) {

Although probably you'd want to cache "thisTransform.GetComponent(touchingThreeScore)".

Your code works fine in Unity 3. Ideally, you'd also GetComponent altogether, and use a generic list and the Find function, but UT hasn't supplied information about the appropriate syntax for lambdas in UnityScript, and I wouldn't bother with generic functions without them.

This didn't help.