The King has been egged during a walkabout in York. One man was detained.