Can a realtor/landlord show an apartment without giving the tenant at least 24 hours notice?

Question Details:

I was called at 9:30 pm last night by the realtor selling my apartment building telling me he was showing the apartment today at 6 pm. I work to jobs and do not always have a tidy apt. I refused saying I needed time to vacuum and mop. He gave me an argument but relented in the end. I want to know if I have that right to tell him I need at least 24 hours notice before he brings a potential new landlord to view my unit. Was I in my legal rights for refusing and asking him to reschedule? Important Notice