@tianwaifeixian pretty simple:
1) for the months you are in CA, you report that income as a non-resident of CA. Pay the tax, whatever it is. File a non-resident CA tax return. (complete this one first!)
2) then complete a NC resident tax return. You will report all your income, including the income earned while in CA. NC will give you a credit of approx. 4.25% times whatever you earned in CA or what you paid to CA, which ever is lower.
you remain an NC resident. Going to CA is temporary.