<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bob McCune &#187; Cocoa</title>
	<atom:link href="http://www.bobmccune.com/category/technology/cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bobmccune.com</link>
	<description>iOS and Java Design, Development, Training, and Mentoring</description>
	<lastBuildDate>Thu, 15 Sep 2011 06:55:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automagic Factories in Objective-C</title>
		<link>http://www.bobmccune.com/2011/04/08/automagic-factories-in-objective-c/</link>
		<comments>http://www.bobmccune.com/2011/04/08/automagic-factories-in-objective-c/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 14:00:39 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=374</guid>
		<description><![CDATA[The Factory pattern is a frequently used creational pattern to help abstract the creation of an object from its clients. Although there are a few specializations of this pattern I&#8217;ll focus on the most commonly used approach and then look at how we can leverage the Objective-C Runtime to make this solution more robust. Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://www.bobmccune.com/wp-content/uploads/2011/04/magic_hat.png" alt="" title="magic_hat" width="150" height="150" class="alignright size-full wp-image-377" />The <a href="http://www.oodesign.com/factory-pattern.html">Factory</a> pattern is a frequently used <a href="http://www.oodesign.com/creational-patterns/">creational pattern</a> to help abstract the creation of an object from its clients.  Although there are a few specializations of this pattern I&#8217;ll focus on the most commonly used approach and then look at how we can leverage the <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/Introduction.html">Objective-C Runtime</a> to make this solution more robust.</p>
<p>Let&#8217;s begin by creating a simple command-line app that creates <code>Animal</code> objects and gets them to speak on command.  The various animal objects will all inherit from the <em>abstract</em> <code>Animal</code> class.<br />
<span id="more-374"></span></p>
<pre>
@interface Animal : NSObject {
}

- (void)speak;
- (NSString *)key;

@end
</pre>
<pre>
@implementation Animal

- (void)speak {
    NSAssert(NO, @"The 'speak' method must be implemented by subclass.");
}

- (NSString *)key {
    // Animal instances will be 'keyed' by their lower case class name
    // Overly simplistic, but will suffice for now
    return [NSStringFromClass([self class]) lowercaseString];
}

@end
</pre>
<p>With the abstract base class complete let&#8217;s create a couple concrete <code>Animal</code> implementations:</p>
<pre>
@implementation Cat
- (void)speak {
    NSLog(@"Meow, Meow...");
}
@end
</pre>
<pre>
@implementation Dog
- (void)speak {
    NSLog(@"Bark, Bark...");
}
@end
</pre>
<p>Our <code>Cat</code> &amp; <code>Dog</code> objects are ready to go so let&#8217;s integrate them into our app and get them to speak.</p>
<pre>
int main (int argc, const char * argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    Animal *cat = [[Cat alloc] init];
    [cat speak];
    [cat release];

    Animal *dog = [[Dog alloc] init];
    [dog speak];
    [dog release];

    [pool drain];
    return 0;
}
</pre>
<p>Running this app will produce the following console output:</p>
<pre>
Meow, Meow...
Bark, Bark...
</pre>
<p>This works as we&#8217;d expect, but the main problem with using the <code>Cat</code> and <code>Dog</code> classes this way is <em>coupling</em>.  Even though we&#8217;ve defined our variables as abstract <code>Animal</code> types we&#8217;re still coupled to the specific subtypes.  This means we can&#8217;t modify our <code>Animal</code> types or evolve their creation without impacting our client code.  This may seem like a trivial matter in this example, but these design decisions can have major impacts on real-world applications.  Let&#8217;s avoid some of the potential ripple effects by introducing a <em>factory</em>.</p>
<h2>Creating Animals</h2>
<p>We&#8217;ll begin by moving the object creation responsibilities from our client to a new object called <code>AnimalFactory</code>.  This factory, as you may have guessed, will be responsible for creating and vending instances of <code>Animal</code>.  A simple, but common implementation of this could be defined as follows:</p>
<pre>
@implementation AnimalFactory

+ (AnimalFactory *)factory {
    return [[[[self class] alloc] init] autorelease];
}

- (Animal *)animalForKey:(NSString *)animalKey {
    Animal *animal = nil;
    if ([animalKey isEqualToString:@"dog"]) {
        animal = [[Dog alloc] init];
    } else if ([animalKey isEqualToString:@"cat"]) {
        animal = [[Cat alloc] init];
    } else {
        NSAssert(NO, @"No Animal found for key:'%@'", animalKey);
    }
    return [animal autorelease];
}

@end
</pre>
<p>The <code>AnimalFactory</code> will determine which instance to create based on the argument passed to the <code>animalForKey:</code> method.  It creates the appropriate instance and returns an <em>autoreleased</em> version of it to the client.  To use this new factory in our client we can make the following changes:</p>
<pre>
AnimalFactory *factory = [AnimalFactory factory];

[[factory animalForKey:@"cat"] speak];
[[factory animalForKey:@"dog"] speak];
</pre>
<p>If you were to run this example again you would see the same output as before, but the introduction of this factory has helped us resolve two specific limitations in our previous implementation:</p>
<ol>
<li>The client is no longer coupled to a particular instance of <code>Animal</code>.  As our requirements change the factory can return alternate instances (<code>FatCat</code>, <code>HotDog</code>, etc.) without impacting our client code.</li>
<li>The client is no longer in the business of object creation which means <em>how</em> an animal is instantiated is no longer its concern.  Additionally, by returning an autoreleased instance we don&#8217;t unnecessarily force memory management responsibilities onto the client.</li>
</ol>
<p>One outstanding problem we have is with the factory itself.  Although the client is better decoupled from the specific types and their creation, the factory itself is not.  Every time we add a new animal to the app we additionally have to make modifications to the factory.  </p>
<blockquote><p>
    <span style="foreground-color: darkGray"><em>[Informercial Guy Voice]</em></span>&nbsp;&nbsp;<strong>There&#8217;s got to be a better way!</strong>
</p></blockquote>
<h2>Enter the Objective-C Runtime</h2>
<p>
Objective-C is a dynamic language where many decisions are deferred until runtime.  This deferment allows for some of the more interesting capabilities of the language and is made possible through the <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">Objective-C Runtime</a>.  Although you can successfully use Objective-C without having much awareness of the runtime, understanding how to interact with it can open up some interesting new possibilities.  </p>
<p>
It would be nice if our <code>AnimalFactory</code> could automatically find and dispense all instances of <code>Animal</code> without us having to continuously modify the factory.  Thanks to the runtime, it can.</p>
<h2>Automagic Factories</h2>
<p>Let&#8217;s begin by creating a utility class called <code>RuntimeUtils</code> containing a method to allow us to dynamically find all instances of a particular type.  This method will be implemented as follows:</p>
<pre>
+ (NSArray *)classStringsForClassesOfType:(Class)filterType {

    int numClasses = 0, newNumClasses = objc_getClassList(NULL, 0);
    Class *classList = NULL;

    while (numClasses < newNumClasses) {
        numClasses = newNumClasses;
        classList = realloc(classList, sizeof(Class) * numClasses);
        newNumClasses = objc_getClassList(classList, numClasses);
    }

    NSMutableArray *classesArray = [NSMutableArray array];

    for (int i = 0; i < numClasses; i++) {
        Class superClass = classList[i];
        do {
            // recursively walk the inheritance hierarchy
            superClass = class_getSuperclass(superClass);
            if (superClass == filterType) {
                [classesArray addObject:NSStringFromClass(classList[i])];
                break;
            }
        } while (superClass);
    }

    free(classList);

    return classesArray;
}
</pre>
<p>This method makes use of two functions defined in <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html"><code>&lt;objc/runtime.h&gt;</code></a>:</p>
<ol>
<li><code>objc_getClassList</code> - This function returns a list of all classes registered with the app.  We'll loop through this list and then filter its results.</li>
<li><code>class_getSuperclass</code> - Returns the superclass of a class.  We recursively walk the inheritance hierarchy of each class to determine if it's a descendant of <code>Animal</code>.  If so, we add its class string to our array.
</ol>
<p>With our <code>RuntimeUtils</code> class now ready, let's go back and revisit the implementation of our factory object.</p>
<h2>Implementing the Magic</h2>
<p>We'll change the implementation of our factory class to leverage this new <code>RuntimeUtils</code> class.  We'll start by implementing the <code>init</code> method.</p>
<pre>
- (id)init {
  if ((self = [super init])) {
    NSArray *animalClassStrings = [RuntimeUtils classStringsForClassesOfType:[Animal class]];
    animals = [[NSMutableDictionary alloc] initWithCapacity:[animalClassStrings count]];
      for (id classString in animalClassStrings) {
        Class animClass = NSClassFromString(classString);
        Animal *animal = [[animClass alloc] init];
        [animals setObject:animal forKey:[animal key]];
        [animal release];
      }
    }
  return self;
}
</pre>
<p>Our <code>init</code> implementation starts by finding all the class strings for the classes extending <code>Animal</code>.  We iterate through the results creating an instance of each class and storing its pointer in the <code>animals</code> dictionary.  With the <code>init</code> method complete let's modify the <code>animalForKey:</code> method.</p>
<pre>
- (Animal *)animalForKey:(NSString *)animalKey {
    Animal *animal = [animals objectForKey:animalKey];
    NSAssert(animal, @"No animal found.  Invalid 'animalType' specified?");
    return animal;
}
</pre>
<p>We now have a greatly simplified <code>animalForKey:</code> method.  Gone are the <code>if/else</code> or <code>switch</code> statements you'd typically see in a factory method.  Instead, we have a simple, generic execution path regardless of the number of animals we add to the application.</p>
<p>To see the benefits of our revamped <code>AnimalFactory</code>, let's make a couple additions to our animal kingdom.</p>
<pre>
@implementation Monkey
- (void)speak {
    NSLog(@"Ooo, Ooo, Eee, Eee");
}
@end
</pre>
<pre>
@implementation Bird
- (void)speak {
    NSLog(@"Tweet, tweet");
}
@end
</pre>
<p>We can go back to our client code and make the following changes:</p>
<pre>
[[factory animalForKey:@"dog"] speak];
[[factory animalForKey:@"cat"] speak];
<strong>[[factory animalForKey:@"monkey"] speak];</strong>
<strong>[[factory animalForKey:@"bird"] speak];</strong>
</pre>
<p>If you run the application again you'll see the new <code>Monkey</code> and <code>Bird</code> instances were automatically registered with the factory without any additional changes!  Winning!</p>
<h2>Conclusion</h2>
<p>Although this was clearly a contrived example, it hopefully illustrates how leveraging the Objective-C Runtime can result in significantly more flexible factory objects.  Some simple modifications could be made to this approach to provide for lazy instantiation or handle more complex object creation.  In a future post I'll provide a more concrete example of how this strategy can be put to good use in a real-world application.</p>
<h2>Resources</h2>
<p><a href="http://www.bobmccune.com/wp-content/uploads/2011/04/AutomagicFactories.zip">Sample Code</a></br><br />
<a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html">Objective-C Runtime Reference</a></br><br />
<a href="http://cocoasamurai.blogspot.com/2010/01/understanding-objective-c-runtime.html">Understanding the Objective-C Runtime</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2011/04/08/automagic-factories-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Core Animation Presentation</title>
		<link>http://www.bobmccune.com/2011/03/13/core-animation-presentation/</link>
		<comments>http://www.bobmccune.com/2011/03/13/core-animation-presentation/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 00:22:48 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Animation]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=320</guid>
		<description><![CDATA[This past week I gave a presentation on Core Animation to the Minnesota CocoaHeads user group. Core Animation is a truly amazing framework and is really the magic ingredient in the iOS user experience. Understanding how to effectively use it can allow you to add new levels of realism and interactivity to your apps. As [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This past week I gave a presentation on <a href="http://developer.apple.com/technologies/ios/graphics-and-animation.html">Core Animation</a> to the <a href="http://www.cocoaheadsmn.org/">Minnesota CocoaHeads</a> user group.  Core Animation is a truly amazing framework and is really the magic ingredient in the iOS user experience.  Understanding how to effectively use it can allow you to add new levels of realism and interactivity to your apps.</p>
<p>As part of the presentation I prepared a number of examples ranging from image effects to 3D animations (OK, 2 1/2 D animations).  If you&#8217;re interested in taking a look you can find the demo on <a href="https://github.com/bobmccune/Core-Animation-Demos">github</a> and the slides are available <a href="http://www.bobmccune.com/works/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2011/03/13/core-animation-presentation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iOS 101: Pattern Images</title>
		<link>http://www.bobmccune.com/2011/03/08/ios-101-pattern-images/</link>
		<comments>http://www.bobmccune.com/2011/03/08/ios-101-pattern-images/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 20:37:02 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=304</guid>
		<description><![CDATA[A common need in an iOS app is to tile a background image on a UIView. It&#8217;s trivial to implement, but not particularly obvious if you&#8217;re new to the platform. The solution is to set the view&#8217;s backgroundColor property to a UIColor instance created from your pattern image. For instance, the following code will create [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A common need in an iOS app is to tile a background image on a <code>UIView</code>.  It&#8217;s trivial to implement, but not particularly obvious if you&#8217;re new to the platform.  The solution is to set the view&#8217;s <code>backgroundColor</code> property to a <code>UIColor</code> instance created from your pattern image.  For instance, the following code will create a pattern image from <code>pattern.png</code>:</p>
<pre>
- (void)viewDidLoad {
  [super viewDidLoad];
  UIImage *patternImage = [UIImage imageNamed:@"pattern.png"];
  self.view.backgroundColor = [UIColor colorWithPatternImage:patternImage];
}
</pre>
<p>This will produce the following effect:</p>
<p><a href="http://www.bobmccune.com/wp-content/uploads/2011/03/pattern_to_view.png"><img src="http://www.bobmccune.com/wp-content/uploads/2011/03/pattern_to_view.png" alt="" title="Pattern to View" width="505" height="493" class="alignnone size-full wp-image-310" /></a></p>
<p>Like most things in Cocoa there is usually an easy solution to the problem you&#8217;re trying to solve, but what it is may not be immediately apparent if you&#8217;re just starting out.  Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2011/03/08/ios-101-pattern-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using iOS 4&#8242;s IBOutletCollection</title>
		<link>http://www.bobmccune.com/2011/01/31/using-ios-4s-iboutletcollection/</link>
		<comments>http://www.bobmccune.com/2011/01/31/using-ios-4s-iboutletcollection/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 23:17:32 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=220</guid>
		<description><![CDATA[Cocoa has long defined the IBAction and IBOutlet keywords. These keywords provide metadata hints to Interface Builder providing it some understanding of your underlying code so you can graphically wire instance variables and properties and set target-action behaviors. For instance, whenever you need a pointer to NIB-defined object you would create a property defined as: [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Cocoa has long defined the IBAction and IBOutlet keywords.  These keywords provide metadata hints to Interface Builder providing it some understanding of your underlying code so you can graphically wire instance variables and properties and set target-action behaviors.  For instance, whenever you need a pointer to NIB-defined object you would create a property defined as:</p>
<pre>
@interface MainViewController : UIViewController {
    UIButton *saveButton;
}
@property (nonatomic, retain) <strong>IBOutlet</strong> UIButton *saveButton;
@end
</pre>
<p>The inclusion of the <code>IBOutlet</code> keyword in the saveButton&#8217;s property definition makes it visible to Interface Builder allowing this connection to be wired graphically as show below:</p>
<p><img src="http://www.bobmccune.com/wp-content/uploads/2011/01/save.png" alt="Interface Builder" title="save" width="346" height="269" class="alignnone size-full wp-image-239" /></p>
<p>Using IBOutlet makes it very easy to define your UI in Interface Builder and simply &#8220;wire&#8221; the object references to your code.  However, it does come with one major drawback in that the relationship from a NIB-defined object to property/ivar is always 1-to-1; there was no way to define a collection of components as a single property in your code.  Thankfully, Apple quietly introduced a new keyword in iOS4+ called IBOutletCollection allowing you to do just this.  Let&#8217;s take a closer look at an example where this can be useful.</p>
<h2>IBOutletCollection</h2>
<p>Like the other keywords previously mentioned, you&#8217;ll find the IBOutletCollection keyword in UINibDeclarations.h, which is part of the UIKit framework.  The new keyword is defined as follows:</p>
<pre>
#ifndef IBOutletCollection
#define IBOutletCollection(ClassName)
#endif
</pre>
<p>You&#8217;ll notice that <code>IBOutletCollection</code> takes a class name parameter.  This allows you specify what are considered valid values for the collection such as <code>UIView</code> or <code>UIButton</code>.  If you&#8217;d prefer you can change the &#8220;type&#8221; argument to <code>id</code> to allow for a heterogeneous collection.  So how could this be useful?</p>
<h2>Putting IBOutletCollection To Work</h2>
<p>I&#8217;ve often found times where I needed references to certain components, but really only in an aggregate way so I could change state on them as a group.  To do this I&#8217;d first need to define separate ivar/property combinations for each component, wire them up in Interface Builder, and then manually collect each pointer into an NSArray and store the collection for later use.  Although this works, it is rather tedious and does add unnecessary bloat to your code.  A better way to handle this type of scenario is to make use of the IBOutletCollection keyword and wire up this relationship in IB.  </p>
<p>In the example below I&#8217;ve defined two unique ivars/properties to hold references to my on &#038; off buttons and then an NSArray to hold a collection of other buttons.  The on/off buttons are used to change the <code>enabled</code> state of the group of &#8220;otherButtons&#8221;.</p>
<pre>
@interface MainViewController : UIViewController {
    UIButton *onButton;
    UIButton *offButton;
    NSArray  *otherButtons;
}

@property (nonatomic, retain) IBOutlet UIButton *onButton;
@property (nonatomic, retain) IBOutlet UIButton *offButton;
@property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *otherButtons;

- (IBAction)toggleButtons:(id)sender;

@end
</pre>
<pre>
@implementation MainViewController

- (void)setButtonsState:(BOOL)state {
   for (id button in self.otherButtons) {
      [button setEnabled:state];
   }
   self.onButton.enabled = !state;
   self.offButton.enabled = state;
}

- (void)viewDidLoad {
   [super viewDidLoad];
   [self setButtonsState:YES];
}

- (IBAction)toggleButtons:(id)sender {
   [self setButtonsState:sender == onButton];
}

- (void)dealloc {
   self.onButton = nil;
   self.offButton = nil;
   self.otherButtons = nil;
   [super dealloc];
}

@synthesize onButton, offButton, otherButtons;

@end
</pre>
<p>I can now easily wire this together in Interface Builder without the need to write any code to collect and store the references to my group of buttons.  This is clearly a contrived example, but I hope you can see the benefit of this small addition to iOS 4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2011/01/31/using-ios-4s-iboutletcollection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CocoaHeads: We&#039;re Off To a Great Start!</title>
		<link>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/</link>
		<comments>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:48:25 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=80</guid>
		<description><![CDATA[I would really like to thank all of you who attended the inaugural CocoaHeads meeting last Thursday. I couldn&#8217;t have been happier with the turnout and participation from everyone. It was also nice to finally meet many of you with whom I&#8217;ve traded emails over the past couple of months. We had a great mix [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I would really like to thank all of you who attended the inaugural CocoaHeads meeting last Thursday.  I couldn&#8217;t have been happier with the turnout and participation from everyone.  It was also nice to finally meet many of you with whom I&#8217;ve traded emails over the past couple of months.</p>
<p>We had a great mix of people at the first meeting ranging from experienced Cocoa, NeXT, and Mac OS developers to those experienced with other languages/platforms, but just starting out with Cocoa and CocoaTouch, to those just starting their journey into software development.  This should make for a very interesting group!</p>
<p><a href="http://anatkinson.com/">Andy Atkinson</a> started polling at the end of the meeting for what technical topics people would like to see at upcoming meetings.  I think the final ones we settled on were:</p>
<ul>
<li><span style="text-decoration:underline">Intro to iPhone Development</span></li>
<li><span style="text-decoration:underline">Overview of RubyCocoa</span></li>
<li><span style="text-decoration:underline">Unit Testing with OCUnit</span></li>
<li><span style="text-decoration:underline">NSFoundation Framework</span></li>
<li><span style="text-decoration:underline">Intro to CoreGraphics</span></li>
<li><span style="text-decoration:underline">Overview of Instruments</span></li>
</ul>
<p>Some additional ones I would personally like to see covered (even if I&#8217;m the one covering them) are overviews of <span style="text-decoration:underline">Core Data</span> and <span style="text-decoration:underline">Core Animation</span>.<br />
Let me know if there are any others that I missed and should be tracking.</p>
<p><a href="http://www.rjohnshields.com/blog/">John Shields</a> wrote up a nice summary of <a href="http://rjohnshields.com/blog/?p=50">his thoughts</a> on the meeting that you should check out.</p>
<p>I&#8217;d like to thank <a href="http://heymansoftware.com/">Bill Heyman</a> and <a href="http://damonallison.com/">Damon Allison</a> for showing us some very cool demos of what they are doing over at <a href="http://codemorphic.net/">CodeMorphic</a>.  Good luck guys and keep &#8216;em coming!  If anyone else would be interested in demoing their products or projects, just let me know and I&#8217;ll find you a slot.</p>
<p>I&#8217;d also like to thank everyone at Synergy Information Services.  Their facilities are great and they also have a larger room available should we need it.  We all also greatly appreciated the pizza and soda!</p>
<p>Vlad will be posting the <span style="text-decoration:underline">Getting Started with Cocoa</span> presentation and sample code to the website.  Keep an eye out at <a href="http://www.synfoserv.com/index.php?option=com_content&#038;view=article&#038;id=73&#038;Itemid=102">Synergy&#8217;s CocoaHeads Page</a> over the next few days if you&#8217;d like to download that content.</p>
<p>BTW, if you are interested in understanding the history of Cocoa and Mac OS X, I&#8217;d recommend checking out <a href="http://www.shawcomputing.net/">David Shaw&#8217;s website</a>.  He has a wealth of information on NeXT, Rhapsody, and Apple that many of you would find very interesting.  Great job David!</p>
<p>As I mentioned the other night I&#8217;ll be giving a presentation on Object-C 2.0 at the July meeting.  This will be a much more detailed look at ObjC which will allow us to dig into its core syntax and features.</p>
<p>I hope to see you all again at the next CocoaHeads meeting on 7/10 @ 6pm.</p>
<p>-Thanks,<br />
 Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Review: Cocoa Programming for Mac OS X, 3rd Edition</title>
		<link>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/</link>
		<comments>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/#comments</comments>
		<pubDate>Tue, 20 May 2008 16:21:21 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=78</guid>
		<description><![CDATA[Over the weekend, I finished reading the 3rd edition of Cocoa Programming for Mac OS X by Aaron Hillegass. The previous edition had long been considered the best introduction to the topic, but it had grown rather out of date given the major changes introduced in the Leopard release of OS X. Thankfully, the 3rd [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.amazon.com/gp/product/0321503619?ie=UTF8&#038;tag=bobmcom-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=0321503619"><img src="http://www.bobmccune.com/wp-content/uploads/2010/06/hillegass.png" alt="" title="Cocoa Programming for Mac OS X" width="150" height="197" class="alignleft size-full wp-image-170" /></a></p>
<p>Over the weekend, I finished reading the 3rd edition of <a href="http://www.amazon.com/gp/product/0321503619?ie=UTF8&#038;tag=bobmcom-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=0321503619">Cocoa Programming for Mac OS X</a> by Aaron Hillegass.  The previous edition had long been considered the best introduction to the topic, but it had grown rather out of date given the major changes introduced in the Leopard release of OS X.  Thankfully, the 3rd edition has been completely revised to reflect the current state of Mac OS X development.</p>
<p><span style="text-decoration:underline">Cocoa Programming for Mac OS X</span> is an introductory guide to programming on the Mac platform.  It provides broad coverage of the core Mac programming concepts you&#8217;ll need to write real world applications, but is not intended to be a definitive reference on the subject.  Aaron&#8217;s presentation of the material is excellent and the code examples really help explain the concepts being covered.</p>
<p>The organization of the book has changed considerably since the last release.  Several less-relevant and irrelevant chapters have been dropped and replaced with chapters covering Core Data, Core Animation, web services, and garbage collection.  Additionally, the existing content and examples have been significantly revised giving this release the feel of a whole new book.</p>
<p>I would highly recommend this title to anyone interested in Mac development.  Even if you own the previous edition, I think you&#8217;ll find the new and revised content well worth the price.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Operation: Cocoa</title>
		<link>http://www.bobmccune.com/2008/03/13/operation-cocoa/</link>
		<comments>http://www.bobmccune.com/2008/03/13/operation-cocoa/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 07:10:28 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2008/03/13/operation-cocoa/</guid>
		<description><![CDATA[Over the past few months I&#8217;ve been spending a lot my free time learning Objective-C and Cocoa. Although it&#8217;s been fun learning a new language and framework, it has been somewhat of an uphill climb. Objective-C was the easy part. If you have some familiarity with C and also some experience with an OO language [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Over the past few months I&#8217;ve been spending a lot my free time learning Objective-C and Cocoa.  Although it&#8217;s been fun learning a new language and framework, it has been somewhat of an uphill climb.  Objective-C was the easy part.  If you have some familiarity with C and also some experience with an OO language like Java, C#, or C++,  you&#8217;ll pick it up within a week or two.  Cocoa, on the other hand, can take quite a bit more time to wrap your head around.  It&#8217;s a very large and robust framework and understanding how to use its constituent parts to form a whole requires a fairly significant investment of time and effort.</p>
<p>One of the biggest challenges to learning Cocoa is the lack of up-to-date books.  There are several on the market, but most are woefully outdated.  The language, development tools, and available frameworks and APIs have changed considerably since these books were written which can present an obstacle to learning from these older references.  Thankfully, there are some new and updated titles coming out this year from <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCocoa-Programming-Mac-OS-3rd%2Fdp%2F0321503619%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383619%26sr%3D1-2&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Aaron Hillegass</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCore-Animation-OS-Compelling-Interfaces%2Fdp%2F1934356107%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383661%26sr%3D1-5&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Bill Dudney</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, and <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCocoa-Design-Patterns-Developers-Library%2Fdp%2F0321535022%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383478%26sr%3D1-2&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Erik Buck</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  I&#8217;ve got &#8216;em all on pre-order!</p>
<p>Although the book market may be a bit lacking at the moment that doesn&#8217;t mean there aren&#8217;t useful resources to be found.  In fact, you&#8217;ll find quite the opposite is true.  <a href="http://developer.apple.com/mac/">Apple&#8217;s Developer Connection</a> posts many references, guides, and sample code at its site.  There are also a number of useful third-party resources I visit regularly including <a href="http://www.macdevnet.com/">MacDevNet</a>, <a href="http://cocoadev.com/">CocoaDev</a>, <a href="http://www.cocoabuilder.com/">CocoaBuilder</a>, and <a href="http://theocacao.com/">Scott Stevenson&#8217;s</a> excellent <a href="http://cocoadevcentral.com/">Cocoa Dev Central</a>.  Additionally, you&#8217;ll find dozens of great blogs and articles in various places.  One of my new favorite Mac dev blogs is Marcus S. Zarra&#8217;s  and Matt Long&#8217;s <a href="http://www.cimgf.com/">Cocoa Is My Girlfriend</a>.  The content is great and the name is brilliant!</p>
<p>The problem isn&#8217;t that there&#8217;s not enough information to be found.  The problem is how do you make sense of it all and more importantly, how do you use this information to build a real application?</p>
<p>To help in this regard I&#8217;m starting a new site called <span style="text-decoration:underline">Operation: Cocoa</span>.  Its purpose will be to provide the aspiring Cocoa developer with a path through the maze.  Although it will likely be a few months before the site is up and running, I&#8217;m already working on content and will be hosting it on this site in the interim.  The first tutorial entitled &#8220;Hello Cocoa&#8221; will be posted in the next week or two.</p>
<p>I&#8217;m very interested to hear any comments or opinions you have about this idea: what you think about the site name, what kind of content would you like to see, etc.</p>
<p>
Thanks,<br/><br />
&nbsp;&nbsp;-Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/03/13/operation-cocoa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Core Animation</title>
		<link>http://www.bobmccune.com/2008/02/03/core-animation/</link>
		<comments>http://www.bobmccune.com/2008/02/03/core-animation/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 07:20:31 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2008/02/03/core-animation/</guid>
		<description><![CDATA[For the past few months I&#8217;ve been spending a considerable amount of my free time learning Objective-C and Cocoa. Apple&#8217;s Leopard release has introduced so many new and interesting developer technologies that I decided it was finally time to dive in and learn to write code for my favorite platform. One of the new Leopard [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>For the past few months I&#8217;ve been spending a considerable amount of my free time learning Objective-C and Cocoa.  Apple&#8217;s Leopard release has introduced so many new and interesting developer technologies that I decided it was finally time to dive in and learn to write code for my favorite platform.</p>
<p>One of the new Leopard APIs I&#8217;ve been excited to learn is called <a href="http://developer.apple.com/graphicsimaging/coreanimation/">Core Animation</a> (CA).  CA is a new Cocoa framework providing you the ability to create UIs with rich animations and compositions by using with a simple, consistent programming model.  This allows you to easily create visual effects for your applications that would be impractical, if not downright impossible, to do on other platforms.</p>
<p>One of the challenges to learning CA (especially given my n00b status) is the lack of books and tutorials on the topic.  So, I was pleasantly surprised to receive an email from the <a href="http://www.pragprog.com/">Pragmatic Programmer</a> guys introducing Bill Dudney&#8217;s new book <a href="http://www.pragprog.com/titles/bdcora"><span style="text-decoration:underline;">Core Animation for OS X</span></a>.  It provides in-depth coverage of all the key concepts including animations, filtering, layering, and 3D effects.  I&#8217;ve just started reading it, but it looks great so far.  I&#8217;ll be sure to write a full review when I complete it.</p>
<p>The book is currently available in &#8220;beta&#8221; PDF form with the final print version available in July.  You can find out more about the book and get your own copy at <a href="http://www.pragprog.com/titles/bdcora"><span style="text-decoration:underline;">its website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/02/03/core-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

