Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 游戏套件/游戏中心-I386_Iphone_Objective C_Xcode_Game Center - Fatal编程技术网

Iphone 游戏套件/游戏中心-I386

Iphone 游戏套件/游戏中心-I386,iphone,objective-c,xcode,game-center,Iphone,Objective C,Xcode,Game Center,我在iOS游戏中心遇到了一些困难 我正在学习一些关于 但一旦我完成代码,就会出现以下错误: Ld /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test normal i386 cd /Users/fgr

我在iOS游戏中心遇到了一些困难 我正在学习一些关于 但一旦我完成代码,就会出现以下错误:

Ld /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test normal i386
    cd /Users/fgringo/Documents/DEVELOPER/Game-Center-Test
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Documents/DEVELOPER/Game-Center-Test -filelist /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Intermediates/Game-Center-Test.build/Debug-iphonesimulator/Game-Center-Test.build/Objects-normal/i386/Game-Center-Test.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework GameKit -framework MediaPlayer -o /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test

ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/GameKit.framework/GameKit, missing required architecture i386 in file
ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/MediaPlayer.framework/MediaPlayer, missing required architecture i386 in file
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKLeaderboard", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKScore", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKAchievement", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKPlayer", referenced from:
      objc-class-ref in GameCenterManager.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

是否已将GameKit.framework添加到项目中?

看起来您尚未将GameKit框架添加到项目中

如果您使用的是Xcode 3.2.x:

  • 右键单击文件树中的
    Frameworks
    组/文件夹(在xcode窗口的左侧)
  • Add
    ,然后选择
    existingframeworks…
  • 滚动至
    GameKit.framework
    并双击它
如果您使用的是Xcode 4:

  • 在文件树中,单击项目(顶部的项目)
  • 选择你的目标
  • 转到主面板上的
    构建阶段
    选项卡
  • 展开带有库的
    链接二进制文件
  • +
    按钮
  • 滚动至
    GameKit.framework
    并双击它

如果您使用的是Xcode 4(与YouTube教程不同),您将以稍微不同的方式添加框架。看:皮奇亚诺,是的。但是我做了和那个家伙说的一样的程序,现在它的错误很清楚了。乔纳森,非常感谢。事实上,我的项目中有GAMEKIT,但我以不同的方式“导入”了它。所以我删除了它,并按照你的建议做了,它很震撼。