Looking at some of the outdoor NYC shots inh that show it is clear that there are times when it is in a studio and when it is 4actually outside in NYC at least for me.
I think that the show is in fact filmed in LA but they have brought the cast out to NYC a few times for some outdoor shots in front of buildings and things like that. As a matter of fact, what they do isn't at all uncommon. Many shows that take place in NYC but aren't filmed here would send the crew and actors out to the city to spend some time filming here. Many is the time that they film them doing just regular things like walking in and out of a building or buying a hot dog form a vendor. I know that CSI NY does this a lot.
"If you try to shag my husband while I am still alive, I will shove the art of motorcycle maintenance up your rancid little Cu**. That's a good dear"
Tom Stoppard's Rock N Roll