Concept: Basic strength in amines depends on the availability of the lone pair on the nitrogen atom and the stabilization of the resulting cation in aqueous solution.
• Aliphatic vs. Ammonia: Alkyl groups are electron-donating ($+I$), which increases lone pair availability. Thus, alkylamines are more basic than $NH_3$.
• Aromatic vs. Ammonia: In aniline ($C_6H_5NH_2$), the lone pair is delocalized into the benzene ring via resonance, making it significantly less available. Aniline is much weaker than $NH_3$.
• Aqueous Solution Factors: In water, basicity is a balance of $+I$ effects, steric hindrance, and salvation (hydrogen bonding).
Step 1: Compare aliphatic amines.
In aqueous solution for methyl-substituted amines, the order is $2^\circ > 1^\circ > 3^\circ$.
For (iv) $(CH_3)_2NH$ (secondary) and (ii) $C_2H_5NH_2$ (primary), the secondary amine is more basic due to the presence of two $+I$ groups and sufficient salvation. So, (iv) $>$ (ii).
Step 2: Place ammonia and aniline.
Ammonia (iii) has no $+I$ groups but no resonance withdrawal, so it sits below aliphatic amines. Aniline (i) has resonance withdrawal, making it the weakest.
Overall order: (iv) $(CH_3)_2NH$ $>$ (ii) $C_2H_5NH_2$ $>$ (iii) $NH_3$ $>$ (i) $C_6H_5NH_2$.