내 게임에서 여전히 작동하고 난이도가 높은 "gameSpeed"가있는 각 난이도는 어려운 선택에 따라 설정됩니다.중복 기호
duplicate symbol _gameSpeed in:
/Users/Ashley/Library/Developer/Xcode/DerivedData/Whack-etfeadnxmmtdkgdoyvgumsuaapsz/Build/Intermediates/Whack.build/Debug-iphonesimulator/Whack.build/Objects-normal/i386/TimedGameLayer.o
/Users/Ashley/Library/Developer/Xcode/DerivedData/Whack-etfeadnxmmtdkgdoyvgumsuaapsz/Build/Intermediates/Whack.build/Debug-iphonesimulator/Whack.build/Objects-normal/i386/GameInfo.o
ld: 1 duplicate symbols for architecture i386
collect2: ld returned 1 exit status
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
난 단지 한 위치에 gameSpeed을 사용하고 있습니다 : 내 응용 프로그램을 실행하려고 할 때
그러나 나는 다음과 같은 오류가 발생합니다.
여기에 있습니다 :이 내 TimedGameLayer.m gameSpeed var에 내 GameInfo.h에
안에
[self schedule:@selector(tryPopMoles:) interval:gameSpeed];
내가 헤더과 같이 가져옵니다
#import "GameInfo.h"
내 GameInfo.h는 다음과 같습니다.
(내 GameInfo.m 파일에)@interface GameInfo : NSObject
+(void)setupGame:(enum GameType)type withArg2:(enum GameDifficulty)difficulty;
+(void)resetGame;
+(void)togglePause;
@end
//Game Type
enum GameType gameType;
enum GameDifficulty gameDifficulty;
//Release Version
NSString *version;
//Settings
int gameSpeed = 1.5;
//Stats
int touches = 0;
int score = 0;
int totalSpawns = 0;
//usables
bool gamePaused = FALSE;
typedef enum GameType {
GameTypeClassic = 0,
GameTypeUnlimited,
GameTypeTimed,
GameTypeExpert,
} GameType;
typedef enum GameDifficulty
{
GameDifficultyEasy = 0,
GameDifficultyMedium,
GameDifficultyHard,
} GameDifficulty;
내 setupGame 기능은 다음과 같습니다 :
+(void)setupGame:(enum GameType)type withArg2:(enum GameDifficulty)difficulty
{
gameType = type;
gameDifficulty = difficulty;
switch(gameDifficulty)
{
case GameDifficultyEasy:
gameSpeed = 1.5;
break;
case GameDifficultyMedium:
gameSpeed = 1.0;
break;
case GameDifficultyHard:
gameSpeed = 0.5;
break;
}
}
임은 완전히 여기 손실 ...
어떤 아이디어? 아래에 여러분의 의견과 귀하의 예제 코드를 기반으로
감사
두 군데에 포함됩니다. 1) 내 @implementation TimedGameLayer 바로 위, 다른 수입과 함께. 그리고 2) 내 다른 게임들과 함께 내 GameInfo.m – Ryuk
실수로 .m 파일을 가져 오지 않았습니까? – Asciiom
아니, 확인했습니다. TeamViewer가 있으면 다음을 볼 수 있습니다 :) – Ryuk