If the parts you're welding are nodular or ductile cast iron, the the popping and spitting are normal. Low quality castings may have pores or non-metallic inclusions inside them that don't react well when the welding arc makes contact. If you didn't aggressively clean the surface, you can also get some bad reactions from sand and/or mold release compounds imbedded in the surface of the casting.
I'll add my opinion to the advice already given and say that brazing is the best way to go, but welding with slow cooling is possible also. Brazing has two advantages.. The first is flux to float out impurities. The second is that the base metal isn't actually melted.
Nodular iron is very similar in chemistry to gray cast iron, with special control over some alloying additives; Magnesium being the most important. The molten gray cast iron is innoculated with a controlled amount of magnesium. This element, plus a controlled cooling rate in the molds causes the excess carbon in the cast iron to form microscopic round nodules, rather than any of the half a dozen structures that are possible. The round nodule shape of the graphite is part of what gives ductile iron it's toughness.
Magnesium melts at a much lower temperature than iron or steel. So if you're welding on nodular cast iron it's important to get in, fuse the material, and get out again in a quick, efficient manner. Pouring a lot of excess heat into the material can boil away some of the magnesium in the weld puddle and nearby material. This causes the material to no longer form ductile iron when the liquid base metal re-solidifies. These microscopic changes in the structures formed by the excess carbon can also cause the material to expand or contract at a different rate then the surrounding material; which causes cracking. Slow cooling helps minimize these thermal stresses.
Welding with a filler metal containing a high amount of Nickel can avoid cracking as well, because the dilution of nickel into the weld and surrounding base metal makes the cast iron more tolerant of shrinkage during cooling. But, there's no guarantee with anything. You've got to hit the Nickel dilution and cooling rates just right. Adding Nickel just makes cooling rate window bigger, if you will.
I'm not saying you cannot weld ductile iron. but I am saying that if you've tried and it's cracked here are some possible reasons why.
Like a couple of others I think brazing is still the most reliable solution, and because the cast iron doesn't get hot enough to melt you avoid all the problems associated with welding.