0
有一個問題,我剛剛安裝了iPhone的cocos2d。
第一個問題是它沒有識別像CCDirectory.h這樣的頭文件。
所以我打開了項目中的用戶搜索路徑,但是這樣我就可以導入頭文件並獲得一個對象指針而不會收到任何警告,但方法無法識別。
這很難解釋,所以看到這樣的代碼:無法使用導入的類方法與cocos2d
頁眉:
#import <UIKit/UIKit.h>
#import <CCMenuItem.h>
#import <cocos2d.h>
內的applicationDidFinishLaunching:
CCMenuItem* item; // This does not give a warning, except for the "unused variable"
// But the class is recognized
[CCMenuItem setFontName: @""]; // Warning
的警告是:
Class method '+setFontName:' not found (return type default to 'id')
而且它不」不承認任何其他方法,只是NSObject的方法。