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.