How much colder depends on how much salt is mixed in with the water. The salt you sprinkle on the ice cube lowers its freezing temperature and, since the ice cube can’t get any colder than it already is, it starts to melt. A little pool of water forms on top of the ice cube and the string sinks into it. As the ice cube melts, it dilutes the salt/water mixture in the little pool; the freezing point starts to go back up again. The ice refreezes, trapping the string. As soon as the ice cube hardens, you can raise it by lifting the string. All this happens very quickly, of course.