Ayub Khan was very anti-China, in fact he made an offer of joint defence to India in 1959, AGAINST China. Relations were not good at that point.
Bhutto's foreign policy legacy - DAWN.COM
But much changed after India attacked us in 1962, during our worst ever famine:
It wasn't China, but Nehru who declared 1962 war - The Times of India
(This is from India's own internal military report, the Henderson-Brooks report).
It was only after this, that China is said to have helped Pakistan to acquire nukes, and other such cooperation. So IF it is true that China helped Pakistan gain nuclear weapons, it was only long after India had already attacked us during our famine (and India still lost).