The key is to get the ice cream as frozen as possible before frying. It's being fried so quickly, that it will not melt the inside. However, if the ice cream balls aren't solid before coating or are left in the oil for too long, it will melt. The cornflake coating provides just enough barrier between the ice cream and the hot oil to keep the ice cream from melting while it cooks.