2
我試圖創建一個將控制iTunes的ObjC應用程序。我需要一種方法來返回iTunes中所有播放列表的數組。奇怪的錯誤與蘋果腳本橋 - iTunes
我得到的最離奇的,無益的錯誤消息不斷。首先代碼:
#import "MusicControl.h"
#import "iTunes.h"
@implementation MusicControl
- (SBElementArray *) playlists {
// Create iTunes Object
iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
NSArray *sources = [iTunes sources];
iTunesSource *librarySource = nil;
for (iTunesSource *source in sources) {
if ([source kind] == iTunesESrcLibrary) {
librarySource = source;
break;
}
}
return [librarySource userPlaylists];
}
@end
我不知道該陣列回報是否工作或沒有,因爲,做一些調試完畢後,我發現,在這轟炸出來是我創建iTunes的對象,這是複製和粘貼Apple's website非常第一線...
我得到的錯誤是:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SBApplication", referenced from:
objc-class-ref in MusicControl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
任何建議作爲發生了什麼事?
我還沒有嘗試過,但我知道這是它。我記得現在在Scripting Bridge的文檔頁面上看到了。謝謝!我無法告訴你我多麼感激你回答我的這個問題! – 2012-02-17 19:11:06