It is made by reacting an iodide such as sodium iodide with silver nitrate . Silver iodide is prepared by reaction of an iodide solution ( e.g. potassium iodide ) with a solution of silver ions ( e.g. , silver nitrate ) .