S&P 500, Nasdaq hit record highs on Apple boost