Fix static_pointer_cast in generated ObjC