Chief Executive Tim Cook said he was "encouraged" by Apple's performance in China.