Sayyidah Aishah (may Allah be pleased with her), the wife of the Prophet (peace and blessings be upon him), narrates: I would not enter (the house) except for a need, and if I came across a sick person while passing, I would ask after him. The Messenger of Allah (peace and blessings be upon him) would put his blessed head out towards me while he (peace and blessings be upon him) was in the mosque, and I would comb it; and he (peace and blessings be upon him) would not enter the house except for a need when he (peace and blessings be upon him) was in i'tikaf.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8592