Even before becoming CEO, Cook has regularly visited mainland China, which is one of Apple's biggest markets and where many of its contract suppliers are based. Apple did not immediately respond to a request for comment on the latest visit.

Days prior to the visit, Internet experts began noticing that Apple's iCloud service had been targeted in a "man-in-the-middle attack" coming from China. Visits to the iCloud website within the country mysteriously returned untrusted digital certificates, a sign that a hacker had tampered with the connection to intercept username and password information.

On Tuesday, Apple began alerting users about the attack, although China was not named in the online posting.

All this occurred just after the company began selling its iPhone 6 in mainland China last Friday. Anti-censorship group GreatFire.org has alleged that the Chinese government is behind the attack, but the country's foreign ministry has denied supporting any form of hacking.

Who might be behind the attack is still a mystery, but China has shown growing concern about the security around Apple products. In July, the country's state-run broadcaster CCTV ran a report alleging that the "Frequent Locations" feature in iOS could be used to spy on users, a claim that Apple later dismissed.

Before the iPhone 6 went on sale in China, government regulators also expressed concern with suspected security flaws in Apple's iOS software, and demanded the company makes changes.

In an online posting, the regulator said it was paying "great attention" to protecting user's privacy on mobile phones. "If it's discovered that any related businesses are involved in violating user's privacy, they will be investigated and dealt with according to the law," the regulator said. Apple later made the changes, and pledged to never interfere with users' information without their permission.

Android remains the dominant mobile OS in China, with a 93 percent market share in the second quarter, according to research firm Canalys. But Apple products remain popular in the country, with the latest iPhones attracting big demand from Chinese customers, and local merchants wanting to resell the devices for a higher price.

In an internal letter circulated online after its latest financial results, Cook said he would be visiting with Apple employees in Beijing this week. On Wednesday, a user on a Chinese social-networking site spotted Cook visiting with workers from its major supplier Foxconn Technology Group.

Copyright 2018 IDG Communications. ABN 14 001 592 650. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of IDG Communications is prohibited.