The structure having opposite charges on adjacent atoms are stable. structure having maximum number of covalent bonds is most stable.
-OCH3 exerts -I and +M effect. +M effect of -OCH3 predominant over -I effect of -OCH3
and Also structure having complete octet are more state. In structure (iv) has complete octet and adjacent opposite charge. but in structure (i) has incomplete octet and -OCH3 group distablized adjacent anion.
Therefore, structure (D) will be more stable resonating structure.