Apple has sent warnings to iPhone users in 100 countries about their device possibly carrying spyware.