One week before Apple Inc. plans to show off its new iPhone, the company is battling to preserve its reputation for protecting users, following the leak of nude photos of celebrities from its online services.

Apple on Tuesday denied that its online systems had been breached, deepening the mystery of how the private photos leaked onto the Internet. Apple said certain celebrity accounts were compromised by "a very targeted attack...