Barcelona is now firmly on many Mediterranean cruise ship itineraries, and if you're arriving on one chances are you'll get off at new cruise ship terminals A, B, C, or D on the Moll Adossat, in the shadow of Montjuïc, roughly a half hour walk from the historic centre of Barcelona This is linked to the rest of the city by the Gate of Europe bridge.
The T3 Portbús provides a shuttle service for cruise ship passengers roughly every 20 minutes (depending on when ships arrive) from the Moll Adossat to the Portal de la Pau at the base of the Ramblas. There are usually taxis waiting in the rank as well (count on paying around €25 to the airport) or you can arrange a private transfer in advance. If you have a car, park in the Litoral Port car park.
Image by Kenny Miller