Don't quote me on it, but .....
It depends whether you've "jail broken" your iPhone or not.
As far as I am aware, it should theoretically only be possible to write viruses targetting jail broken iPhones. "Jail Broken" iPhones can only run things which are available through the iTunes App Store and therefore (one would hope) are reasonably well vetted by Apple for hidden nasties.
Never say never, as they say... but that's my 2 <insert currency> worth.
See also here from Sophos, the well respected anti-virus people...
Do I need anti-virus for my iPhone? | SophosLabs blog