{"id":2619,"date":"2022-08-30T15:26:22","date_gmt":"2022-08-30T15:26:22","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/04\/sbapplication-error-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:26:22","modified_gmt":"2022-08-30T15:26:22","slug":"sbapplication-error-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/sbapplication-error-collection-of-common-programming-errors\/","title":{"rendered":"SBApplication error-Collection of common programming errors"},"content":{"rendered":"<p>To use ScriptingBridge with iTunes, I used:<\/p>\n<pre><code>iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@\"com.apple.iTunes\"];\n<\/code><\/pre>\n<p>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:<\/p>\n<pre><code>Apple Mach-O Linker (Id) Error\n\"_OBJC_CLASS_$_SBApplication\", referenced from:\nobjc-class-ref in AppDelegate.o\nld: symbol(s) not found for architecture x86_64\n<\/code><\/pre>\n<p>and<\/p>\n<pre><code>Apple Mach-O Linker (Id) Error\nLinker command failed with exit code 1 (use -v to see invocation)\n<\/code><\/pre>\n<p>How do I solve this issue? I copied and pasted that line from the Apple Developer Scripting Bridge Programming Guide, so I can&#8217;t imagine it would cause a problem.<\/p>\n<ol>\n<li>\n<p>Since the SpringBoard isn&#8217;t a framework and you can&#8217;t link to it when compiling you must access the class at runtime. The method I would recommend is this:<\/p>\n<pre><code>#import \nSBApplication* iTunes = [objc_getClass(\"SBApplication\") applicationWithBundleIdentifier:@\"com.apple.iTunes\"];\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-02-04 09:41:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>To use ScriptingBridge with iTunes, I used: iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@&#8221;com.apple.iTunes&#8221;]; 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 &#8220;_OBJC_CLASS_$_SBApplication&#8221;, referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2619","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2619"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2619\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}