I'm having the same problem since upgrading to Yosemite with both my iPhone 4s (ios8) and my iPad 2 (ios7). Connecting either device causes the "trust this device" prompt on the device. Clicking "trust" does not help, as iTunes throws a "iTunes could not connect to this iPhone (or iPad). This device is no longer connected dialog and will not recognize the device.
The only thing that solves this for me is rebooting my computer. After a reboot my devices connect and sync just fine but eventually the problem starts again.
To clarify - I've been using both devices with this computer previously with no issues. It's a relatively new problem (for me) so I am thinking it's probably an issue that's been caused by a recent iTunes update rather than Yosemite itself.