It's certainly true, as Lsos implies, that if there is a back-emf present, as with an electric motor when it's running, or in an electromagnet when fed with a.c., then the current will be lower than for the same system with no back-emf.
Yet it is possible to design an electromagnet so that it takes a safe current when a suitable p.d. is placed across it, even when there is no back-emf. Like many of us, I would imagine, I played with home-made electromagnets as a child. There were no nasty incidents of overheating, and the batteries lasted a reasonable time. I'm sure someone had advised me to put plenty of thin wire on my iron core!
It's all a matter of design. In general, motors use thicker wire and less of it than you'd use for an electromagnet designed to run for more than a few seconds on a d.c. supply.
[Can't resist saying to Drakkith that he's right, of course, but making the resistor out of extra wire added to the electromagnet coil will have the advantage of making the electromagnet stronger! Just teasing.]