{"id":4024,"date":"2013-12-18T23:22:55","date_gmt":"2013-12-19T04:22:55","guid":{"rendered":"http:\/\/www.lordandrei.com\/blog\/?p=4024"},"modified":"2013-12-18T23:22:55","modified_gmt":"2013-12-19T04:22:55","slug":"the-projects-first-coding-hiccup","status":"publish","type":"post","link":"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/","title":{"rendered":"The Project&#8217;s first coding hiccup."},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignright size-medium wp-image-4025\" alt=\"confused cat huh\" src=\"http:\/\/www.lordandrei.com\/blog\/wp-content\/uploads\/2013\/12\/confused-cat-huh-300x213.jpg\" width=\"300\" height=\"213\" srcset=\"http:\/\/www.lordandrei.com\/blog\/wp-content\/uploads\/2013\/12\/confused-cat-huh-300x213.jpg 300w, http:\/\/www.lordandrei.com\/blog\/wp-content\/uploads\/2013\/12\/confused-cat-huh-150x106.jpg 150w, http:\/\/www.lordandrei.com\/blog\/wp-content\/uploads\/2013\/12\/confused-cat-huh.jpg 864w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>Well, it was bound to happen working on all the backend stuff today. Once I knew that I was reading the data in; today it was all about putting the data in a commonly accessible area; formatting the data for different calls; and then letting those calls bask in the glory of real data.<\/p>\n<p>At least that was the plan. (Hang on kids, it gets technical now)<\/p>\n<p>Originally, the data was pulled in at app startup using the call:<\/p>\n<pre>sendAsynchronousRequest:queue:completionHandler:<\/pre>\n<p>Then I moved that out of the startup system and into its own data management class. All was going along well, but I couldn&#8217;t get the shared data where I wanted it. So I decided to pull out the big guns. We call that &#8220;Gang of 4.&#8221; This is the bible of software design patterns. I reached into the tome (well, not actually; as I don&#8217;t really need the book as much anymore) and called on one of my favourite (albeit most overly used and accursed) patterns: The Singleton.<\/p>\n<p>The singleton, is muchly like building a cookie cutter for a one of a kind cookie. You take great care in making a cookie cutter, which could make lots of cookies; but this one is specially crafted so that people will simply have to share the one (and only one) cookie it will ever cut out.<\/p>\n<p>That&#8217;s when life got weird. Suddenly the call above stopped working. It didn&#8217;t cause an error; it didn&#8217;t complain; it didn&#8217;t throw a wild exception and crash the device&#8230; It just blithely skipped over it.<\/p>\n<p>I tried wiping the object files and compiling fresh. That didn&#8217;t work. I tried changing and maintaining the queue. That didn&#8217;t work. I changed how the singleton was instantiated&#8230; Nope. Just weirdness all around. Sadly; I got to this point about 30 minutes before I had to leave to pick up my boy from school. (My spouse got the flu). I figured, Okay&#8230; I guess I&#8217;ll spend 3-4 hours fixing it more tonight.<\/p>\n<p>This also would not come to pass because I also am deeply invested in the show &#8220;The Sing Off&#8221; and have been writing reviews and analysis&#8230;es&#8230;(plural?!?!). Granted, if you read this blog&#8230; which you are at the moment (take my word on it) , then you probably have noticed a few of those posts.<\/p>\n<p>So tomorrow: I have to write my Sing Off review from tonight, spend about 5 hours figuring out why the API took a hike, and then gearing up for the penultimate episode of the Sing Off. Oh what a hard life I lead at the moment. Honestly, I&#8217;m hoping that it&#8217;s 1 hour of fix and 4 hours continuing to get the real data in the app.<\/p>\n<p>Oh, and to those who said they&#8217;d be interested in testing once I get to the iPad; Please remember that iPhone apps run just fine on the iPad and you can test them early. (Yes, S&#8230; I&#8217;m looking at you first and foremost \ud83d\ude09<\/p>\n<p>We&#8217;ll figure out what went kerschlump tomorrow. I&#8217;m going to actually try to get some sleep tonight.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-4024\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-4024\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-4024\" class=\"share-pinterest sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pinterest (Opens in new window)<\/span><\/a><\/li><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Tumblr (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Well, it was bound to happen working on all the backend stuff today. Once I knew that I was reading the data in; today it was all about putting the data in a commonly accessible area; formatting the data for different calls; and then letting those calls bask in the glory of real data. At [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-4024\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-4024\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-4024\" class=\"share-pinterest sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pinterest (Opens in new window)<\/span><\/a><\/li><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon no-text\" href=\"http:\/\/www.lordandrei.com\/blog\/2013\/12\/18\/the-projects-first-coding-hiccup\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\" ><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Tumblr (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_publicize_message":"The Project's first coding hiccup. When #objc #APIs randomly stop doing anything.","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1373,9],"tags":[1382,711,1383,1379,1384],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1X6ba-12U","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts\/4024"}],"collection":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/comments?post=4024"}],"version-history":[{"count":1,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts\/4024\/revisions"}],"predecessor-version":[{"id":4026,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/posts\/4024\/revisions\/4026"}],"wp:attachment":[{"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/media?parent=4024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/categories?post=4024"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lordandrei.com\/blog\/wp-json\/wp\/v2\/tags?post=4024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}