The direct iodination of alkane fail to product an alkyl iodide.
This is because the by-product HI reduces iodoalkane back to alkane.
Hence, strong oxidizing agents like iodic aicd, nitric acid or HgO are used which destroys the HI and prevent the reversibility of the reaction.
Iodo compounds can be obtained by halogen exchange reaction in which chloro or bromo alkanes are treated with NaI in acetone.
C2H5Br+NaI→C2H5I+NaBr