Tim Cook has called the memory shortage a ‘hundred-year flood.’ Here’s how Apple is handling it as other companies struggle.