2017-10-11 164 views
0

更具體地說我收到錯誤「無法與初始化類型‘GKPhotoSize *’的參數|類型‘詮釋’的價值」Xcode中無法初始化類型的參數「GKPhotoSize」

,並在我的ISN_GameCenter行.mm的樣子:

void _ISN_loadGKPlayerPhoto(char* playerId, int size) { 
    NSString* mPlayerId = [ISN_DataConvertor charToNSString:playerId]; 
    [[ISN_GameCenterManager sharedInstance] loadImageForPlayerWithPlayerId:mPlayerId size:size]; 
} 

參數被傳遞給這樣的說法:

- (void) loadImageForPlayerWithPlayerId:(NSString *)playerId size:(GKPhotoSize) size; 

我不知道爲什麼這個開始發生,所有的不能初始化參數鍵入Stack doesnt引用這個特殊情況。我不知道爲什麼這開始發生或如何解決它。

回答

2

長到GKPhotoSizeNormal的大小或GKPhotoSizeSmall,它會工作。這取決於您的照片需要多大尺寸。

void _ISN_loadGKPlayerPhoto(char* playerId, int size) { 
    NSString* mPlayerId = [ISN_DataConvertor charToNSString:playerId]; 
    [[ISN_GameCenterManager sharedInstance] loadImageForPlayerWithPlayerId:mPlayerId size:GKPhotoSizeNormal]; 
} 
+0

謝謝,我把它改成了GKPhotoSizeSmall,它工作。 – fourthking

+0

你能解釋我可以如何設置這個尺寸嗎?在Unity編輯器生成設置?在XCode中?我每次構建時都必須重做更改嗎?最後但並非最不重要的是:GKPhotoSize是關於什麼的?我沒有在我的應用程序中使用Game Center。 – holgerm

+0

對不起,我沒有提到:我使用的是Unity Game Engine,並且生成了用於iOS的構建文件。所以我不能簡單地更改生成的文件... – holgerm

相關問題