Stocks end flat as Apple shares drop