<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Objective-C on Thoughts and Ramblings</title>
    <link>http://www.cod3r.com/tags/objective-c/</link>
    <description>Recent content in Objective-C on Thoughts and Ramblings</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 29 Apr 2013 14:45:43 +0000</lastBuildDate>
    <atom:link href="http://www.cod3r.com/tags/objective-c/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Month with AppCode</title>
      <link>http://www.cod3r.com/2013/04/a-month-with-appcode/</link>
      <pubDate>Mon, 29 Apr 2013 14:45:43 +0000</pubDate>
      <guid>http://www.cod3r.com/2013/04/a-month-with-appcode/</guid>
      <description>&lt;p&gt;Anyone who uses multiple IDEs along with Xcode recognizes just how far behind Xcode is compared to others. I would even go as far as to argue it is at least half a decade behind Eclipse. Features which I have long grown use to having are completely absent in Xcode. Then, about a month ago, I discovered &lt;a href=&#34;http://www.jetbrains.com/objc/&#34; title=&#34;AppCode&#34;&gt;AppCode&lt;/a&gt; and started using it for my Obj-C development at work. I could repeat the &lt;a href=&#34;http://www.jetbrains.com/objc/features/index.html&#34;&gt;feature set mentioned on their website&lt;/a&gt;, but instead I&amp;rsquo;ll assume you&amp;rsquo;ve read that and outline the crucial parts.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C Has Learned</title>
      <link>http://www.cod3r.com/2013/02/what-objective-c-has-learned/</link>
      <pubDate>Tue, 05 Feb 2013 18:14:00 +0000</pubDate>
      <guid>http://www.cod3r.com/2013/02/what-objective-c-has-learned/</guid>
      <description>&lt;p&gt;In a few of my recent posts, I outlined some things which I believe that Objective-C can learn from Java, the &lt;a href=&#34;http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/&#34; title=&#34;What Objective-C can learn from Java, Part 5 (Exceptions)&#34;&gt;most recent&lt;/a&gt; discussing error handling. In order to avoid the impression that I may not like Objective-C, I figured I should outline some of what I believe are the most important improvements Objective-C has made.&lt;/p&gt;&#xA;&lt;h3 id=&#34;properties&#34;&gt;Properties&lt;/h3&gt;&#xA;&lt;p&gt;When properties were first introduced, I read several who described them as simply syntax sugar. While they didn&amp;rsquo;t initially add much of anything that couldn&amp;rsquo;t already be done in the language before, they did yield one important feature: generated code. The code necessary in a setter, in particular the releasing of a previous value and setting the new value, was often fraught with errors. Despite code examples on a proper setter from Apple, I saw several cases where a setter failed to release the previous value, or retain the new value, or more commonly, do those two in the correct order. Enabling the compiler to generate this code for the programmer removed many of these errors.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C can learn from Java, Part 5 (Exceptions)</title>
      <link>http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/</link>
      <pubDate>Tue, 17 Apr 2012 02:32:47 +0000</pubDate>
      <guid>http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/</guid>
      <description>&lt;p&gt;This is one past the last is a series of blog posts I&amp;rsquo;m writing on things that Objective-C can learn from Java. I&amp;rsquo;m writing this because I&amp;rsquo;m seeing a series of ignorant tweets stating how much Java sucks. The other parts can be found here:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/&#34;&gt;Part 1 (Generics)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-2-abstract-classes/&#34;&gt;Part 2 (Abstract Classes)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-3-single-source-file/&#34;&gt;Part 3 (Single Source File)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/&#34;&gt;Part 4 (Namespace)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 5 (Exceptions)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Anyone who programs in Java for a short period of time becomes well aware of Java&amp;rsquo;s exceptions. To the new programmer, they may be a bit of an annoyance, but to anyone designing enterprise-level code, they are a necessity. Objective-C has exceptions too, but they are so weakly defined in the language and so overlooked, it&amp;rsquo;s almost as if they were nothing more than an afterthought. In fact, one can argue that the exception handling in C++ is superior to what one would find in Objective-C.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C can learn from Java, Part 4 (Namespace)</title>
      <link>http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/</link>
      <pubDate>Sat, 08 Jan 2011 21:18:40 +0000</pubDate>
      <guid>http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/</guid>
      <description>&lt;p&gt;This is the last is a series of blog posts I&amp;rsquo;m writing on things that Objective-C can learn from Java. The other parts can be found here:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/&#34;&gt;Part 1 (Generics)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-2-abstract-classes/&#34;&gt;Part 2 (Abstract Classes)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-3-single-source-file/&#34;&gt;Part 3 (Single Source File)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 4 (Namespace)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/&#34;&gt;Part 5 (Exceptions)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For one who has programmed in other object oriented languages, Objective-C stands out with its complete lack of namespace. As a result, classes have a prefix, such as Apple&amp;rsquo;s common &lt;em&gt;NS&lt;/em&gt; and &lt;em&gt;UI&lt;/em&gt; prefixes. On the mac side of things, every class under the sun seemed to start with &lt;em&gt;NS&lt;/em&gt;, such as &lt;code&gt;NSString&lt;/code&gt;, and confusion is added when on the iOS side, several classes start with &lt;em&gt;UI&lt;/em&gt;, such as &lt;code&gt;UIView&lt;/code&gt;. This is due to the fact that without a concept of namespace, Objective-C cannot have two classes with the same name, regardless of whether the classes are public or not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C can learn from Java, Part 3 (Single Source File)</title>
      <link>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-3-single-source-file/</link>
      <pubDate>Thu, 30 Dec 2010 16:16:28 +0000</pubDate>
      <guid>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-3-single-source-file/</guid>
      <description>&lt;p&gt;This is the third is a series of blog posts I&amp;rsquo;m writing on things that Objective-C can learn from Java. The other parts can be found here:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/&#34;&gt;Part 1 (Generics)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-2-abstract-classes/&#34;&gt;Part 2 (Abstract Classes)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 3 (Single Source File)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/&#34;&gt;Part 4 (Namespace)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/&#34;&gt;Part 5 (Exceptions)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Objective-C still retains a lot of its heritage from it&amp;rsquo;s C beginnings. This includes using two files, a header and a source file, for each class. In a strictly object oriented environment, the header file contains the class definition (super-class and instance variables), public property definitions, and any public function declarations. The source file contains all of the function implementations, including synthesize statements. In contrast, Java contains all the functions of both files in a single file. To one who knows better, as in one who has used the single file environment, the two files for each class becomes a pain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C can learn from Java, Part 2 (Abstract Classes)</title>
      <link>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-2-abstract-classes/</link>
      <pubDate>Mon, 27 Dec 2010 21:54:20 +0000</pubDate>
      <guid>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-2-abstract-classes/</guid>
      <description>&lt;p&gt;This is the second is a series of blog posts I&amp;rsquo;m writing on things that Objective-C can learn from Java. The other parts can be found here:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/&#34;&gt;Part 1 (Generics)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 2 (Abstract Classes)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-3-single-source-file/&#34;&gt;Part 3 (Single Source File)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2011/01/what-objective-c-can-learn-from-java-part-4-namespace/&#34;&gt;Part 4 (Namespace)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.cod3r.com/2012/04/what-objective-c-can-learn-from-java-part-5-exceptions/&#34;&gt;Part 5 (Exceptions)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;When one is using object oriented design, a common practice is to lump similar classes together with a common super-class and include the common functionality in that super-class. In doing such design, a common problem is for the super-class to require some information that can only be computed by the sub-class. The solution is for the super-class to make a function call on itself which the sub-class implements. For example, I recently designed a class which simplifies storage of an object in a SQL row, but it knows nothing about the actual field names or values stored in the database. In this case, I made a function, which subclasses implement, to retrieve this data. In Java, this is simply done through an abstract method in an abstract class.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Objective-C can learn from Java, Part 1 (Generics)</title>
      <link>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/</link>
      <pubDate>Sat, 04 Dec 2010 22:38:29 +0000</pubDate>
      <guid>http://www.cod3r.com/2010/12/what-objective-c-can-learn-from-java-part-1-generics/</guid>
      <description>&lt;p&gt;This is the first is a series of blog posts I&amp;rsquo;m going to write over the next several days on things that Objective-C can learn from Java. I&amp;rsquo;ve been programming in Java since 1997, and in Objective-C since 2001. The two languages have a lot of similarities, but there are a few design principles in which Java excels and Objective-C is left behind. This is understandable considering that Objective-C is older than Java, and Java borrowed heavily from Objective-C when it was designed. In this series I&amp;rsquo;m only going to discuss changes to the language; these items will have very little, if any, impact on the runtime. For the purposes of this discussion, I&amp;rsquo;m going to use Java&amp;rsquo;s terminology since it is more familiar with the programming public. This means I&amp;rsquo;ll talk about functions instead of selectors, and interfaces instead of protocols.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working With Core Data</title>
      <link>http://www.cod3r.com/2009/05/working-with-core-data/</link>
      <pubDate>Wed, 20 May 2009 21:49:34 +0000</pubDate>
      <guid>http://www.cod3r.com/2009/05/working-with-core-data/</guid>
      <description>&lt;p&gt;When I redesigned &lt;a href=&#34;http://appletv.nanopi.net/&#34;&gt;Sapphire&lt;/a&gt;, I decided that the metadata back end would be best served by &lt;a href=&#34;http://developer.apple.com/macosx/coredata.html&#34;&gt;Apple&amp;rsquo;s Core Data Framework&lt;/a&gt;. While the framework has a lot of power, several shortcomings in the implementation hindered its potential.&lt;/p&gt;&#xA;&lt;p&gt;First, I should start with the many things that Apple did correctly in Core Data.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The whole data model with relationships and properties is quite powerful. With this data model, one can represent many data sets in a simple manner, such as the example below: &lt;a href=&#34;http://www.cod3r.com/images/2009/05/core-data-model.png&#34;&gt;&#xA;  &lt;figure&gt;&#xA;    &lt;img src=&#34;http://www.cod3r.com/images/2009/05/core-data-model-300x188.png&#34; alt=&#34;core-data-model&#34;&gt;&#xA;    &lt;center&gt;&lt;figcaption&gt;core-data-model&lt;/figcaption&gt;&lt;/center&gt;&#xA;  &lt;/figure&gt;&#xA;&#xA;&lt;/a&gt; This example shows part of the data model within Sapphire pertaining to TV shows, where a TV shows contains multiple seasons, each of which contains multiple episodes. Additionally, an episode contains one or more sub-episodes, to handle the case where a single file or DVD contains multiple episodes. Lastly, the show and season objects extend from a superclass &lt;code&gt;CategoryDirectory&lt;/code&gt;, which contains some common properties to all collections.&lt;/li&gt;&#xA;&lt;li&gt;Since the relationships are defined, they can be automatically maintained. In the above example, if an episode&amp;rsquo;s show relationship is set to a particular &lt;code&gt;TVShow&lt;/code&gt; object, that show&amp;rsquo;s object will automatically have the episode added to its &lt;code&gt;episodes&lt;/code&gt; relationship.&lt;/li&gt;&#xA;&lt;li&gt;Delete rules can be set such that if an object is removed, the delete can cascade to remove other objects as well. This is useful in the case of removing a directory, and all the files and directories contained within it.&lt;/li&gt;&#xA;&lt;li&gt;Saving to a file is easy since the details of reading and writing a file are handled by Core Data&lt;/li&gt;&#xA;&lt;li&gt;While I didn&amp;rsquo;t use it, undo management is also built into the system.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So, with all these advantages, why is Core Data not used more often. The answer is that it contains numerous short comings.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
