This sort of thing happened to me once. Forget about iOS. When I just bought my very first iMac G5, yes, the non-Intel one, some dude from Malaysia could switch on my iMac remotely using his smartphone. He never told me how but I would never let that the son-of-a-bitch into my house again. Anybody knows how you could prevent tho from happening? There is a way to remotely cold boot your iMac, as I read it somewhere in the net. If you live in a dense apartment block, somebody, your neighbor can hack into your wifi into your system and see what are in your folders. This is scary.
Here's what I think happened:
1) Your wifi is either unprotected, WEP, or you let him on it. So he could get your network.
2) He has the ethernet address of your iMac (easily done by sniffing traffic)
3) He asked you to turn off the iMac.
4) He sends a Wake-on-LAN packet to that ethernet address.
5) *ding* Your iMac turns on. You crap your pants.
It's expected behavior. It's not a bug, it's actually designed that way, and practically every server (PC, Mac, Sparc, PPC, Itanium, etc.) is designed with this feature nowadays.
No, it does not mean he can take your data. Unless your file sharing is turned on and your password is so easily guessable.
Anyways, to turn that feature off, go to System Preferences:Energy Saver and uncheck "wake for network access" or something along that line depending on your OS version.