error: syntax error before 'typeof'
Add this line to the top of your test case:
#define typeof __typeof__
What seems to be happening is that the ObjC compiler on the iPhone has renamed 'typeof' to '__typeof__'. The macro above will add the old version back in. Some Googleing seems to suggest that this is related to C99 compatibility.