The issue seems to be an interference with the default MIN(a,b) macro in one of the iOS frameworks.
Got it working by modifying the following files:
OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp OpenCV-2.2.0/modules/core/include/opencv2/core/operations.hpp
The modification involved creating another MIN macro in both files, I called it __MIN(a,b):
#define __MIN(a,b) ((a)<(b)?(a):(b))
and replacing all MIN(...) calls with __MIN(...).
After the changes opencv compiles without errors.