Build Error for Iphone Developer

Hi, I know this has been answered before but I've signed up as an iphone developer and have had the iphone SDK installed on my computer but still don't understand the explanation on why I get this error "Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain".

I once had the problem that my certificate was only valid for a limited time and needed to be updated. After updating xcode tried to use the old one until i deleted it and restarted xcode. Apple s***s.

You have to move the certificate in the keychain from system to login. Then it will appear correctly in xcode.