기본적으로 인터페이스가 불완전하여 계속할 수 없기 때문에 구현에 포함해야하는 프로토콜이 있습니다.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
오류가, 내가 보여줄 수있는 더 많은 파일을 "구현되지 프로토콜의 메소드"하지만에 방을 구하십시오.이 코드만으로이 문제를 해결할 수 있는지 알기로했습니다.