The magnetic property of nails could be used to just pull them out with a magnet. The difference in boiling points between water and iron or steel is hundreds of degrees Celsius so you could apply heat and just boil the water away.
The mixture of ice cubes and nails can be separated by using a magnet to pull out the nails, as they are metallic and magnetic. After the nails are removed, the ice cubes can be melted if necessary for further use. This method takes advantage of the different physical properties of the materials involved.
;