Hey,
Remember that the cocos2d source repository has been moved to github:
http://github.com/cocos2d/cocos2d-iphone/tree/develop
If you want to use cocos2d with SDK 4.0, you need to download the latest source code from github from the "develop" branch.
$ git clone http://github.com/cocos2d/cocos2d-iphone.git develop