因此,基本上我的接口中有一个协议,我需要包含在我的实现中,因为我得到一个不完整的错误,因此无法继续。Cocos2d,需要在我的实现文件中包含协议
。 .h文件
@interface waveLayer1 : CCLayer <GameKitHelperProtocol>
{
...
}
.m文件
@implementation waveLayer1
GameKitHelper.h文件
#import "cocos2d.h"
#import <GameKit/GameKit.h>
@protocol GameKitHelperProtocol
-(void) onLocalPlayerAuthenticationChanged;
-(void) onFriendListReceived: (NSArray*)friends;
-(void) onPlayerInfoReceived:(NSArray*)players;
@end
@interface GameKitHelper : NSObject {
id<GameKitHelperProtocol> delegate; bool isGameCenterAvailable; NSError* lastError;
}
@property (nonatomic, retain) id<GameKitHelperProtocol> delegate;
@property (nonatomic, readonly) bool isGameCenterAvailable; @property (nonatomic, readonly) NSError* lastError;
+(GameKitHelper*) sharedGameKitHelper;
// Player authentication, info
-(void) authenticateLocalPlayer;
-(void) getLocalPlayerFriends;
-(void) getPlayerInfo:(NSArray*)players;
@end
的错误是我有更多的文件,我可以显示 “未实现的协议方法”,但节省空间我决定看看你是否可以帮助我解决这个问题只用这些代码