Nearly equiatomic NiTi alloy is hydrothermally treated in a urea solution at 150°C to form nanostructures at the surface, with the aim to improve the structural quality of sol-gel deposited TiO2 film. Nanosheets film of ammonium titanate is formed on NiTi alloy after 8 h hydrothermal treatment, and the sol-gel TiO2 film on it is smooth and crack-free. Anatase TiO2 films consisting of nanoparticles and granular deposits are formed on the NiTi samples hydrothermally treated for 16 h and 24 h. The subsequently deposited TiO2 films have short cracks, because the nanostructured films can not completely balance volume shrinkage of the gel film during the drying and heat treatment processes. Water contact angles of the duplex treated NiTi samples increase during ageing in air, but are all reduced to below 10 after 2 h UV irradiation treatment. Potentiodynamic polarization tests in 0.9% NaCl solution indicate that the duplex treated NiTi samples have much better corrosion resistance than the polished one.