Apple boss Tim Cook says the firm ‘did not foresee the magnitude of economic deceleration’ in China.