SBApplication error-Collection of common programming errors
To use ScriptingBridge with iTunes, I used:
iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
However, when I run the application, (I have traced the source of the error to the above line), I get a build failed, and these errors:
Apple Mach-O Linker (Id) Error
"_OBJC_CLASS_$_SBApplication", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
and
Apple Mach-O Linker (Id) Error
Linker command failed with exit code 1 (use -v to see invocation)
How do I solve this issue? I copied and pasted that line from the Apple Developer Scripting Bridge Programming Guide, so I can’t imagine it would cause a problem.
-
Since the SpringBoard isn’t a framework and you can’t link to it when compiling you must access the class at runtime. The method I would recommend is this:
#import SBApplication* iTunes = [objc_getClass("SBApplication") applicationWithBundleIdentifier:@"com.apple.iTunes"];