Apple could be about to spend big to improve its artificial intelligence offering, chief executive Tim Cook has suggested as he revealed the company’s latest results.