"Pedantic" means in the manner of a teacher, especially one who likes to follow rules.
If you say someone is pedantic, it means he talks in a way that is intended to instruct. It is often used in a critical way, sometimes even as an insult, so "pedantic" doesn't just mean "like a teacher". Instead, it means "TOO MUCH like a teacher".
"Spare me your pedantic ways" means "stop being pedantic". It is an insult.