I was having major problems with iTunes seemingly related to it having problems attaching my iPhone 4S over Wi-Fi etc. Every time I opened iTunes it would find my iPad quickly and then either not find my iPhone, or find it and the sync arrows would just keep spinning - which would normally be followed by the "iTunes could not connect to this iPhone..." error. It was getting really aggrevating and iTunes was essentially unusable it was freezing so often.
The following worked for me (on Mac OS X 10.7.2 Lion):
- Just to be safe, reboot your iPhone and restart iTunes
- Plug your iPhone into your computer
- Sync from iTunes
- Uncheck "Sync with this iPhone over Wi-Fi"
- Sync from iTunes
- Quit iTunes
- Open iTunes
- Sync from iTunes
- Check "Sync with this iPhone over Wi-Fi"
- Sync from iTunes
- Unplug your iPhone (it should remain in the iTunes sidebar connected Wi-Fi)
- Sync from iTunes one last time (it should sync over Wi-Fi).
I know this seems absolutely ridiculous and overkill, and it is. I'm not sure if every step is needed but these steps / overkill worked for me. The difference is like night and day. iTunes opens fine now and finds my iPad and iPhone fairly quickly - or at least as quick as it used to, and no error messages.