Setup local network on Mac and share it via WiFi, but with no internet connection
If you have WiFi turned on then you have a pizza slice icon at the right of the menu bar. If it isn't there then open Network in System Preferences to make sure WiFi is on and you have Show Wi-Fi status in menu bar selected.

Select Create Network... which will open up a dialog where you can specify a network name and security. I usually change security to 40-bit WEP just so the link is secure.

You can now connect to this network from your iPhone in the same way as any other WiFi net.