I had an interesting experience yesterday. While flying a rented Cessna 182S around the SFO area on a recreational flight, my pilot-rated passenger pointed out that the "volts" annunciator had come on. The ammeter was showing a small discharge, and RPM was in the green, so it was apparent that the alternator had gone offline. I turned off both of the avionics masters and cycled the master switch, but each time I did the latter, the annunciator came back on after a few seconds, so it was evident that we needed to terminate the flight. I then turned on only one avionics bus in order to conserve battery power. Unfortunately, the GPS and the moving map display are on separate buses, so that meant that we no longer had usable moving map information. That, together with the fact that the plane has no DME, complicated the task of avoiding an airspace bust. Further complicating the problem was that the weather was MVFR in the part of the area where the failure occurred, so it was difficult to identify enough visual landmarks to be sure of our position relative to the nearby charlie and bravo airspace. I got out my portable GPS, but it took much longer than normal to acquire the satellites, which was quite frustrating! Eventually it did come up, and fortunately it confirmed that we were still outside of the bravo and charlie, and we were able to remain so until we landed. After the flight, it occurred to me that if I had turned on my iPad, it probably would have acquired our position more quickly than my handheld GPS did. In the future, whenever I am flying in complex airspace, I think I will keep a backup GPS position source turned on from the start of the flight, especially when the weather is marginal. That would greatly reduce the workload in case of an avionics problem. Another thing I could have done better was to turn off the alternator side of the master switch once it became clear that the alternator wasn't coming back on line. That would presumably have further reduced the load on the battery.