Apple chief executive officer John Ternus warned that Apple's profit margins could weaken due to rising memory costs