There are a few ways of dealing with getting stopped at an apartment complex gate. There is the 'tunnel vision' technique. To truly perfect this skill you must be on a bicycle to facilitate quick getaways and be immune to yelled threats. Another technique is the 'dense foreigner' skill. No explanation needed. Finally, there is the 'listen to the ChinesePod podcast' technique, highly recommended and transferable to any third degree grilling, Chinese or not.
This is Basic content. Purchase a Subscription in the ChinesePod Store to access.