Following several online tutorials, I managed to get Cocos2D added to my Cocoa Touch (UIKit) project. Problem is, I'm able to #import "cocos2d.h"
at the top of any one of my files and my game compiles and runs fine, working just as it did before, but I don't have access to any of the cocos classes, like CCNode, CCLayer, etc.
To give you an idea of what the app does, currently, the main menu UITableView comes up, scrolls as it should, buttons that lead to various view controllers (facebook, twitter, new game creation, store, settings, etc.) all work fine. Back buttons in each view return the user to the main menu table view. This is pretty much all it does, as of now. The idea at this point would be to pass the baton to a Cocos2D scene--where the gameplay would be--when the user taps on one of the UITableViewCell's that represents a current match.
The process I used to add Cocos2D to my project was this:
Also worth noting, perhaps, is that when I create a new file in my existing project "cmd + n", the only options available to me under Cocos2D templates is the CCNode class.
Am I missing something, here? Again, to be clear, I can import the cocos2d.h file and it looks as though everything will work fine. But, when I try to define anything that starts with a "CC", autocomplete shows nothing. Any help would be appreciated. Beating my head against the wall, here. TIA
The autocomplete issue is most likely because of the recursive search path. Xcode has problems indexing recursive header search paths (especially if you just drop in a .xcodeproj). Change it to an absolute path, add multiple paths if the source files are spread across multiple folders.
With Xcode 4 you shouldn't drop in a xcodeproj to another project anymore. Use a workspace to combine multiple projects side-by-side in a single workspace. See Kobold2D for an example (or just use it if you continue to have problems, because these things are already solved in Kobold2D).