Added ios5 rotation handling. Fixed issue 13