When I tell my 2yo dd to stop hurting me she throws a fit. She acts very angry, but many difficult emotions end up coming out as anger, even in adults. If I ask her, "Are you crying because you're sorry for hurting mommy?" She says yes (usually - sometimes its something else) and seems to feel better immediately. I'll go on to reassure her that I know she doesn't want to hurt me and that I will be Ok and then show her an alternative to the behavior (pet instead of pinch for example). By then we are way past screaming and are now learning. This works very well for me.
She has been strictly limitted on nursing. I wanted her to have other ways of relating to me - it seemed to be all about my breasts for a while and I didn't like that. Now we just nurse for bedtime and nap time. It started with rules like, Not while mommy's eating. No she wasn't happy about it, but it didn't take long for her to accept it and now she takes some pride about getting "bigger" when it comes to nursing and moving slowly toward weaning. I've let the limits become her accomplishments.
Now, the night nursings have been trickier - neither of us reason well at 3am and 5 minutes of screaming feels like an hour. But I am now working on night time limits. And during the day, she totally agrees with me that she CAN make it until morning so I'm going to help her do this too.. slowly... when I have the chance to nap..