Synthesis of CdS nanocomposites using macroporous ion-exchange resins