Do you need to measure the voltage of this 24V signal or just detect if its present or not?
and does it HAVE to be isolated? or just able to withstand spikes?
Thinking of the the lowest component count possible...
On micros with clamp diodes intended for this purpose (eg AVR) you can use only a large resistor to an AC source.
Then you use the micro to detect if the input pin is toggling from the AC or not.
The trade-off for having a component count of 1 is more complicated MCU code to do the freq detection.
One of the Atmel appnotes shows 230VAC phase and netural being connected to a micro through 1Meg resistors. The micro can then detect the 50Hz phase of the mains by timing the pins logic changes. 1Meg is high enough no mains voltages spikes can push enough current to damage the IC.
You would use less than 1Meg for 24VAC, I would try 100K to start with and if your micro doesnt have clamp diodes that can handle this you can always add them externally then you're component count would just be the resistor and two diodes.
With just the 100K resistor... 30mA max port current * 100,000R = ok to 3kV spikes.
Or you could raise the component count by 1 by adding a TVS diode, then it would be able to withstand pretty much anything.