Tim Cook visits China as demand for iPhone falters