I’ll make it quick: My iPhone wouldn’t sense the headphones when I plugged them in. I tried restarting, tweaking with settings, etc; nothing helped. The forums suggested taking it to an Apple store for maintenance.
However; I discovered the reason myself: There was a small piece of cotton stuck in the headphone port of my iPhone. It probably got in there when the phone was in my pocket, and it was preventing the headphone jack from connecting with the port.
Using some air bending skills and a paperclip, I have carefully removed the cotton, and everything went back to normal.
I am sharing this information because it may save you a trip to the Apple store as well.