What would be the best way to cast an object to an int?

object obj = new obj();
int i;

i = int.parse(obj.ToString()); this way??

or

i = (int)obj; or this way?

Cheers