Can iPhone 4 use GPS when out of cell tower range? There seems to be some dispute on whether the iPhone can still get a GPS signal when out of cell tower range, see this archived Apple support thread, for example.

I had a friend out in the woods hunting this weekend, and he said that he couldn't get a location via gps, it was just giving errors.

Does this depend on how the app is coded? Are there specific location-aware mapping apps (like the built-in maps tool) that someone can firm either do or don't work properly with no wireless signal?

Update: I guess its kind of obvious that it entirely depends on how the app is designed. The built-in maps app tries to download map tiles from the internet, and won't be able to do that, so that probably explains his errors.

So my underlying question really is: If I'm going camping, do I need to buy a dedicated "wilderness" GPS like one of these? Or is there an iPhone app that can do the same things when away from a wireless/cell signal?
This summer I took some photos out of cell range and they were all geotagged so it's definitely possible to use GPS out of cell range, but some apps (like the Maps app) use a data connection to get map tiles and routing data, so those features wouldn't work if you're not in range of either cellular data or wifi.