4. In Rt $\triangle A B C$, $\angle C=90^{\circ}, A C=3$, $B C=4$, points $I$ and $O$ are the incenter and circumcenter of $\triangle A B C$, respectively. Then $\tan \angle I O A=(\quad)$.
(A) 1
(B) $\frac{\sqrt{3}}{3}$
(C) $\sqrt{3}$
(D) 2
4.D.

As shown in Figure 2, let $\odot I$ be tangent to sides $A C$, $B C$, and $A B$ at points $D$, $E$, and $F$, respectively. Connect $I D$, $I E$, and $I F$. Then $I D \perp A C$, $I E \perp B C$, and $I F \perp A B$.

In the right triangle $\triangle A B C$, by the Pythagorean theorem, we have
$$
A B=\sqrt{A C^{2}+B C^{2}}=5 .
$$

It is also easy to see that quadrilateral $C D I E$ is a square, so
$$
\begin{array}{l}
I F=I D=C D=\frac{1}{2}(A C+B C-A B)=1, \\
A F=\frac{1}{2}(A C+A B-B C)=2 .
\end{array}
$$

Since $O$ is the midpoint of $A B$, we have
$$
A O=\frac{1}{2} A B=\frac{5}{2} \text {. }
$$

In the right triangle $\triangle I F O$, $F O=A O-A F=\frac{5}{2}-2=\frac{1}{2}$. Therefore, $\tan \angle I O F=\frac{I F}{F O}=2$.