“Homeless with money,” a protester sneered, referring to the woman and her phone.

While local residents often object when the city opens a homeless shelter in their midst, the vitriol in Elmhurst since the city began moving families into the hotel in early June has shocked New York officials. Because many of those opposed to using the hotel as a shelter are Chinese immigrants, the conflict has also produced discomfiting images of immigrant families and the mostly black and Latino homeless families shouting insults at one another. A local civic group, Communities of Maspeth and Elmhurst Together, has organized a series of protests, including one in late June in which some of the protesters yelled at the shelter residents to “Get a job!” The homeless families responded that their opponents should “go back to China.”

Both the protest organizers and city officials now seem to want to avoid a repeat of that scene. On Tuesday the city sent buses to take the shelter residents and their children to a movie, to keep them away from the protest. And the organizers tried to keep the speakers’ criticism focused on the city’s policy, rather than on the homeless themselves. There were occasional lapses, as when a man translating a speech into Mandarin inserted a sentence saying that the city should not “put this garbage in our community.”

Mayor Bill de Blasio has made it a top priority to tackle the housing crisis by building or preserving some 200,000 units of affordable housing. He has promised to stem the city’s record numbers of homeless people in shelters by starting rent subsidy programs to help working and chronically homeless families.

But with those programs not yet in place, his administration is struggling to house the tens of thousands of people, including some 11,000 families, currently seeking shelter. With the city dependent on private landlords to supply space for shelters and nonprofit service providers to run them, it does not have many options for where to locate shelters.