Apple delivered its best-ever June quarter for iPhone sales and watched its shares fall anyway, as a warning about supply constraints and rising costs unnerved investors.

The stock dropped more than 7% before Friday’s open, wiping out something in the region of $360bn in market value, days after Tim Cook had already warned that a memory-chip shortage could push prices up.

The headline numbers were strong. iPhone revenue hit $54.25bn in the quarter, up almost 22% and a record for the period, comfortably ahead of Wall Street’s expectations of around $53.86bn.

The problem was the guidance, not the quarter. Apple forecast revenue growth of 9% to 11% for the current quarter, short of the roughly 12% analysts had penciled in, and projected only mid-teens growth for the iPhone.

Cook was clear about the cause. The softer outlook reflected “supply constraints, rather than weak demand,” he said, an unusual position for a company more used to worrying about whether people will buy its products.

The constraint is the AI boom itself. A global scramble for advanced chips and memory, driven by data-centre build-outs, has tightened supply and driven up costs across the industry, and Apple is not immune.

Those shortages now reach Apple’s core products. The company said limited access to advanced chipmaking capacity was constraining supplies of the iPhone, Mac, and iPad, the three pillars of its hardware business.

Memory is the sharpest squeeze. Prices for the chips that go into phones and computers have surged as AI servers soak up capacity, turning a component Apple once took for granted into a strategic worry.

The pain is being felt well beyond Apple. The same memory crunch has pushed up prices on everything from streaming boxes to Macs, as consumer electronics compete with AI data centres for the same scarce chips.

The company has been hunting for supply. Apple has been lobbying Washington to let it buy memory from China’s CXMT as prices climb, a sign of how far it will go to keep its production lines fed.

Analysts framed the quarter as a collision. “Demand robustness is running into a wall of supply and cost challenges,” JP Morgan wrote, capturing the paradox of a company selling all it can make but unable to make enough.

There is a pricing lever, if Apple chooses to pull it. TD Cowen argued the company could raise iPhone prices without denting demand much, a tempting option if costs keep climbing into the holiday season.

The timing is delicate for another reason. The results land during a leadership handover, with Cook due to step down in September and hardware chief John Ternus taking over as chief executive.

Ternus inherits a good problem and a hard one. He takes over a company with record momentum and a looming CEO transition, but also one whose growth is now gated by forces outside Cupertino’s control.

The market reaction fits a wider pattern. Strong results have repeatedly been met with falling share prices this year, as investors fret about the cost of the AI boom, much as they did when TSMC posted record revenue and its stock fell.

For Apple, the supply story cuts both ways. Constraints that cap sales today also point to demand it cannot yet satisfy, which is a more comfortable place to sit than the reverse.

The bigger question is margins. If memory and chip costs keep rising and Apple holds prices, its industry-leading margins take the hit; if it raises prices, it tests how much that loyalty is really worth.

Cook’s parting quarters have set a high bar. Record iPhone sales are a strong note to leave on, but the outlook he hands Ternus is shaped less by what customers want than by what the supply chain can deliver.

Get the TNW newsletter

Get the most important tech news in your inbox each week.