Typically, there are four reasons your iPhone does not connect with your computer.
One of the advantages of using an iPhone with Mac OS X is the simplicity: you plug in the phone, make any changes you want and remove it. If your computer refuses to recognize the phone, though, the Mac's simplicity becomes a liability. In these situations, the computer does not give you much guidance. Generally, your iPhone does not connect for one of four reasons: it needs recharging, your computer isn't configured properly, you need to restart your phone or computer or you need to reinstall iTunes.
Recharge Your iPhone
Sometimes your phone simply will not appear on the desktop. Other times, you get an "unknown error" message. One of the first things you should try is recharging your iPhone. Even though it draws current through the USB cable and starts to recharge, if your iPhone's battery charge is very low, it cannot communicate with your computer. To resolve this, leave it plugged into your computer until it is fully charged. To charge the iPhone more quickly, plug it into a wall outlet.
Computer Specifications
To use an iPhone on your Mac, your computer must be running Mac OS X version 10.5.8 or higher; you'll also need an available USB 2.0 port and the most recent version of iTunes. If your computer does not meet one or more of these requirements, you can resolve it by adding a USB 2.0 hub to give you additional ports or updating to the most recent version of iTunes or Mac OS X (which you might have to purchase).
Restarts
Sometimes restarting your computer or iPhone will let the devices communicate properly.
To restart your iPhone, hold down the "Sleep/Wake" button at the top of the phone for several seconds. A slider bar appears that tells you to "slide to power off." Slide it to deactivate your iPhone. Hold down the "Sleep/Wake" button to restart the iPhone.
To restart your Mac, click the Apple icon in the top left corner of the screen. You can also press the power button and choose the "Restart" option. Select "Restart." A confirmation window opens. Click "Confirm" to restart.
Reinstalling iTunes
Your copy of iTunes may be corrupt. To fix it, you need to uninstall and then reinstall iTunes. To uninstall iTunes, navigate to Finder > Applications and drag the iTunes icon to the Trash Can. Restart your computer.
To reinstall iTunes, open the iTunes download page (see Resources). Click the "Download Now" button. A download dialog opens. Choose "Save." Select a save location from the Finder. Click "Select." iTunes will download. Open the folder that contains the file.
Double-click the iTunes.dmg file. The Install window opens. Drag the program icon to the "Applications" shortcut. This installs iTunes. Open iTunes.
Following these steps will usually fix the problem. If it does not, you may need to delete all the iTunes system files and reinstall it again.