It does use wi-fi first.
http://manuals.info.apple.com/enUS/iPhone_iOS4_UserGuide.pdf
"How iPhone Connects to the Internet
iPhone connects to the Internet using either a Wi-Fi network or a cellular data network. iPhone does the following, in order, until connected:
Connects over the last Wi-Fi network you used that’s available.
If no previously used Wi-Fi networks are available, iPhone shows a list of Wi-Fi networks in range. Tap a network and, if necessary, enter the password to join. Networks that require a password show the lock icon next to them. You can prevent iPhone from automatically showing available networks. See “Wi-Fi” on page 192.
If no Wi-Fi networks are available or you choose not to join any, iPhone connects to the Internet over a cellular data network ( , , or ). You can prevent iPhone from using cellular data in Settings. See “Network” on page 196.
If no Wi-Fi networks are available and a cellular data network isn’t available, iPhone cannot connect to the Internet."