Apple posts record 2nd-quarter sales with gains in iPad, services