我正在尝试将Cocoa SoundCloud API集成到我的iPhone / iPad应用程序中。 我已经按照这里详细说明的说明进行操作,但是当我尝试构建和运行我的项目时,我会收到以下错误消息:
Apple Mach-O链接器(Id)错误
我对iPhone开发很陌生,无法解决问题。我的猜测是缺少一个框架,但我已按步骤3添加了框架:
Ld "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp" normal i386
cd "/Users/curuser/Dropbox/iPhone Apps/MyApp"
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator -F/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator -filelist "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -all_load -ObjC -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -framework UIKit /Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/SoundCloudAPI/SoundCloudAPI -framework Security -framework OAuth2Client /Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/libSoundCloudAPI.a -lOAuth2Client -framework AudioToolbox -framework Foundation -o "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp"
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
我对iPhone开发很陌生,无法解决问题。我的猜测是缺少一个框架,但我已按步骤3添加了框架:
现在Target需要知道它应该链接的新库。所以在项目中,选择目标,在Build Phases中转到Link Binary with Libraries部分。添加以下内容:
- libSoundCloudAPI.a(或桌面上的SoundCloudAPI.framework)
- libOAuth2Client.a(或桌面上的OAuth2Client.framework)
- Security.framework
- AudioToolbox.framework(如果您想要流式传输)
但是当我添加libSoundCloudAPI.a和libOAuth2Client.a时,它显示为工作区中缺少文件(带有虚线边框图标的红色)。
AVAudioQueuePlayer
来从SoundCloud流式传输。 - dpactri