Catalan and Spanish have very interesting roles within Barcelona (and Catalunya as a whole). They have a lot of history and politics surrounding them, and it becomes more apparent when speaking with residents.
There are a lot of completely bilingual families, and within those places the two languages are pretty equal. One guy I know told me that he regularly switches between the two with groups of friends, depending on who he is talking to. Other people are more "catalanista" and insistent on speaking only Catalan. Some people grew up during Franco's years and never had the opportunity to learn it.
Like most bilingual communities, people are pretty accommodating. It is usually just a natural response to switch to Castilian when someone sounds non-native in Catalan. I have lived fairly far up in the city in a couple different neighborhoods (Gracia and Sant Gervasi), and both have mainly Catalan-speaking families (that is, they prefer Catalan to Castilian). Catalan is really used quite a bit; it is especially noticable when interacting on a business or education level (one example are the University of Barcelona's stats showing that about 70% of their filology department's classes are taught in Catalan).
Fascinating topic. :)