To stop a cast iron frying pan from rusting over time, avoid washing it using regular dishwashing liquid. Use table salt instead. This method will also rid the pan of persistent odors from spices used during cooking.