<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1128,38 +1128,10 @@
 						&lt;object class=&quot;NSCustomView&quot; id=&quot;260292442&quot;&gt;
 							&lt;reference key=&quot;NSNextResponder&quot; ref=&quot;439893737&quot;/&gt;
 							&lt;int key=&quot;NSvFlags&quot;&gt;310&lt;/int&gt;
-							&lt;string key=&quot;NSFrame&quot;&gt;{{0, 20}, {623, 229}}&lt;/string&gt;
+							&lt;string key=&quot;NSFrameSize&quot;&gt;{623, 249}&lt;/string&gt;
 							&lt;reference key=&quot;NSSuperview&quot; ref=&quot;439893737&quot;/&gt;
 							&lt;string key=&quot;NSClassName&quot;&gt;MBCoverFlowView&lt;/string&gt;
 						&lt;/object&gt;
-						&lt;object class=&quot;NSButton&quot; id=&quot;184616755&quot;&gt;
-							&lt;reference key=&quot;NSNextResponder&quot; ref=&quot;439893737&quot;/&gt;
-							&lt;int key=&quot;NSvFlags&quot;&gt;292&lt;/int&gt;
-							&lt;string key=&quot;NSFrame&quot;&gt;{{6, 0}, {33, 19}}&lt;/string&gt;
-							&lt;reference key=&quot;NSSuperview&quot; ref=&quot;439893737&quot;/&gt;
-							&lt;bool key=&quot;NSEnabled&quot;&gt;YES&lt;/bool&gt;
-							&lt;object class=&quot;NSButtonCell&quot; key=&quot;NSCell&quot; id=&quot;18111438&quot;&gt;
-								&lt;int key=&quot;NSCellFlags&quot;&gt;-2080244224&lt;/int&gt;
-								&lt;int key=&quot;NSCellFlags2&quot;&gt;134217728&lt;/int&gt;
-								&lt;string key=&quot;NSContents&quot;&gt;Round Rect Button&lt;/string&gt;
-								&lt;object class=&quot;NSFont&quot; key=&quot;NSSupport&quot;&gt;
-									&lt;string key=&quot;NSName&quot;&gt;LucidaGrande&lt;/string&gt;
-									&lt;double key=&quot;NSSize&quot;&gt;1.200000e+01&lt;/double&gt;
-									&lt;int key=&quot;NSfFlags&quot;&gt;16&lt;/int&gt;
-								&lt;/object&gt;
-								&lt;reference key=&quot;NSControlView&quot; ref=&quot;184616755&quot;/&gt;
-								&lt;int key=&quot;NSButtonFlags&quot;&gt;-2033958657&lt;/int&gt;
-								&lt;int key=&quot;NSButtonFlags2&quot;&gt;164&lt;/int&gt;
-								&lt;object class=&quot;NSCustomResource&quot; key=&quot;NSNormalImage&quot;&gt;
-									&lt;string key=&quot;NSClassName&quot;&gt;NSImage&lt;/string&gt;
-									&lt;string key=&quot;NSResourceName&quot;&gt;NSAddTemplate&lt;/string&gt;
-								&lt;/object&gt;
-								&lt;string key=&quot;NSAlternateContents&quot;/&gt;
-								&lt;string key=&quot;NSKeyEquivalent&quot;/&gt;
-								&lt;int key=&quot;NSPeriodicDelay&quot;&gt;400&lt;/int&gt;
-								&lt;int key=&quot;NSPeriodicInterval&quot;&gt;75&lt;/int&gt;
-							&lt;/object&gt;
-						&lt;/object&gt;
 					&lt;/object&gt;
 					&lt;string key=&quot;NSFrameSize&quot;&gt;{623, 249}&lt;/string&gt;
 					&lt;reference key=&quot;NSSuperview&quot;/&gt;
@@ -1713,14 +1685,6 @@
 					&lt;/object&gt;
 					&lt;int key=&quot;connectionID&quot;&gt;452&lt;/int&gt;
 				&lt;/object&gt;
-				&lt;object class=&quot;IBConnectionRecord&quot;&gt;
-					&lt;object class=&quot;IBActionConnection&quot; key=&quot;connection&quot;&gt;
-						&lt;string key=&quot;label&quot;&gt;addItem:&lt;/string&gt;
-						&lt;reference key=&quot;source&quot; ref=&quot;593156221&quot;/&gt;
-						&lt;reference key=&quot;destination&quot; ref=&quot;184616755&quot;/&gt;
-					&lt;/object&gt;
-					&lt;int key=&quot;connectionID&quot;&gt;455&lt;/int&gt;
-				&lt;/object&gt;
 			&lt;/object&gt;
 			&lt;object class=&quot;IBMutableOrderedSet&quot; key=&quot;objectRecords&quot;&gt;
 				&lt;object class=&quot;NSArray&quot; key=&quot;orderedObjects&quot;&gt;
@@ -2308,7 +2272,6 @@
 						&lt;object class=&quot;NSMutableArray&quot; key=&quot;children&quot;&gt;
 							&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
 							&lt;reference ref=&quot;260292442&quot;/&gt;
-							&lt;reference ref=&quot;184616755&quot;/&gt;
 						&lt;/object&gt;
 						&lt;reference key=&quot;parent&quot; ref=&quot;972006081&quot;/&gt;
 					&lt;/object&gt;
@@ -2632,20 +2595,6 @@
 						&lt;reference key=&quot;object&quot; ref=&quot;593156221&quot;/&gt;
 						&lt;reference key=&quot;parent&quot; ref=&quot;1049&quot;/&gt;
 					&lt;/object&gt;
-					&lt;object class=&quot;IBObjectRecord&quot;&gt;
-						&lt;int key=&quot;objectID&quot;&gt;453&lt;/int&gt;
-						&lt;reference key=&quot;object&quot; ref=&quot;184616755&quot;/&gt;
-						&lt;object class=&quot;NSMutableArray&quot; key=&quot;children&quot;&gt;
-							&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
-							&lt;reference ref=&quot;18111438&quot;/&gt;
-						&lt;/object&gt;
-						&lt;reference key=&quot;parent&quot; ref=&quot;439893737&quot;/&gt;
-					&lt;/object&gt;
-					&lt;object class=&quot;IBObjectRecord&quot;&gt;
-						&lt;int key=&quot;objectID&quot;&gt;454&lt;/int&gt;
-						&lt;reference key=&quot;object&quot; ref=&quot;18111438&quot;/&gt;
-						&lt;reference key=&quot;parent&quot; ref=&quot;184616755&quot;/&gt;
-					&lt;/object&gt;
 				&lt;/object&gt;
 			&lt;/object&gt;
 			&lt;object class=&quot;NSMutableDictionary&quot; key=&quot;flattenedProperties&quot;&gt;
@@ -2840,8 +2789,6 @@
 					&lt;string&gt;420.IBPluginDependency&lt;/string&gt;
 					&lt;string&gt;450.IBPluginDependency&lt;/string&gt;
 					&lt;string&gt;451.IBPluginDependency&lt;/string&gt;
-					&lt;string&gt;453.IBPluginDependency&lt;/string&gt;
-					&lt;string&gt;454.IBPluginDependency&lt;/string&gt;
 					&lt;string&gt;5.IBPluginDependency&lt;/string&gt;
 					&lt;string&gt;5.ImportedFromIB2&lt;/string&gt;
 					&lt;string&gt;56.IBPluginDependency&lt;/string&gt;
@@ -3069,8 +3016,6 @@
 					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
 					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
 					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
-					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
-					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
 					&lt;reference ref=&quot;9&quot;/&gt;
 					&lt;string&gt;com.apple.InterfaceBuilder.CocoaPlugin&lt;/string&gt;
 					&lt;reference ref=&quot;9&quot;/&gt;
@@ -3143,10 +3088,6 @@
 				&lt;object class=&quot;IBPartialClassDescription&quot;&gt;
 					&lt;string key=&quot;className&quot;&gt;MBCoverFlowViewController&lt;/string&gt;
 					&lt;string key=&quot;superclassName&quot;&gt;NSViewController&lt;/string&gt;
-					&lt;object class=&quot;NSMutableDictionary&quot; key=&quot;actions&quot;&gt;
-						&lt;string key=&quot;NS.key.0&quot;&gt;addItem:&lt;/string&gt;
-						&lt;string key=&quot;NS.object.0&quot;&gt;id&lt;/string&gt;
-					&lt;/object&gt;
 					&lt;object class=&quot;IBClassDescriptionSource&quot; key=&quot;sourceIdentifier&quot;&gt;
 						&lt;string key=&quot;majorKey&quot;&gt;IBProjectSource&lt;/string&gt;
 						&lt;string key=&quot;minorKey&quot;&gt;MBCoverFlowViewController.h&lt;/string&gt;</diff>
      <filename>English.lproj/MainMenu.xib</filename>
    </modified>
    <modified>
      <diff>@@ -413,7 +413,9 @@ static NSString *MBCoverFlowViewSelectionIndexContext;
 	for (NSObject *object in itemsToAdd) {
 		CALayer *layer = [self _newLayer];
 		[layer setValue:object forKey:@&quot;representedObject&quot;];
-		[object addObserver:self forKeyPath:self.imageKeyPath options:0 context:&amp;MBCoverFlowViewImagePathContext];
+		if (self.imageKeyPath) {
+			[object addObserver:self forKeyPath:self.imageKeyPath options:0 context:&amp;MBCoverFlowViewImagePathContext];
+		}
 		[self _refreshLayer:layer];
 	}
 	
@@ -422,7 +424,9 @@ static NSString *MBCoverFlowViewSelectionIndexContext;
 	[itemsToRemove removeObjectsInArray:self.content];
 	for (NSObject *object in itemsToRemove) {
 		CALayer *layer = [self _layerForObject:object];
-		[[layer valueForKey:@&quot;representedObject&quot;] removeObserver:self forKeyPath:self.imageKeyPath];
+		if (self.imageKeyPath) {
+			[[layer valueForKey:@&quot;representedObject&quot;] removeObserver:self forKeyPath:self.imageKeyPath];
+		}
 		[layer removeFromSuperlayer];
 	}
 	
@@ -438,13 +442,13 @@ static NSString *MBCoverFlowViewSelectionIndexContext;
 }
 
 - (void)setImageKeyPath:(NSString *)keyPath
-{
-	// Remove any observations for the existing key path
-	for (NSObject *object in self.content) {
-		[object removeObserver:self forKeyPath:self.imageKeyPath];
-	}
-	
+{	
 	if (_imageKeyPath) {
+		// Remove any observations for the existing key path
+		for (NSObject *object in self.content) {
+			[object removeObserver:self forKeyPath:self.imageKeyPath];
+		}
+		
 		[_imageKeyPath release];
 		_imageKeyPath = nil;
 	}
@@ -455,7 +459,9 @@ static NSString *MBCoverFlowViewSelectionIndexContext;
 	
 	// Refresh all the layers with images at the new key path
 	for (CALayer *layer in [_scrollLayer sublayers]) {
-		[[layer valueForKey:@&quot;representedObject&quot;] addObserver:self forKeyPath:self.imageKeyPath options:0 context:&amp;MBCoverFlowViewImagePathContext];
+		if (self.imageKeyPath) {
+			[[layer valueForKey:@&quot;representedObject&quot;] addObserver:self forKeyPath:self.imageKeyPath options:0 context:&amp;MBCoverFlowViewImagePathContext];
+		}
 		[self _refreshLayer:layer];
 	}
 }</diff>
      <filename>MBCoverFlowView.m</filename>
    </modified>
    <modified>
      <diff>@@ -28,9 +28,7 @@
 
 
 @interface MBCoverFlowViewController : NSViewController {
-	NSArray *items;
+	
 }
 
-- (void)addItem:(id)sender;
-
 @end</diff>
      <filename>MBCoverFlowViewController.h</filename>
    </modified>
    <modified>
      <diff>@@ -31,27 +31,7 @@
 @implementation MBCoverFlowViewController
 
 - (void)awakeFromNib
-{
-	NSMutableArray *images = [NSMutableArray array];
-	
-	NSString *file;
-	NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:@&quot;/Users/matt/Pictures/Photo Booth&quot;];
-	
-	int count = 0;
-	while ((file = [dirEnum nextObject])) 
-	{
-		NSImage *image = [[NSImage alloc] initWithContentsOfFile:[@&quot;/Users/matt/Pictures/Photo Booth&quot; stringByAppendingPathComponent:file]];
-		if (image != nil) {
-			[image setName:file];
-			[images addObject:image];
-		}
-		[image release];
-		
-		count++;
-	}
-	
-	items = [images copy];
-	
+{	
 	NSViewController *labelViewController = [[NSViewController alloc] initWithNibName:nil bundle:nil];
 	NSTextField *label = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 10, 10)];
 	[label setBordered:NO];
@@ -73,24 +53,38 @@
 	[(MBCoverFlowView *)self.view setAccessoryController:labelViewController];
 	[labelViewController release];
 	
+	[(MBCoverFlowView *)self.view setImageKeyPath:@&quot;image&quot;];
 	[(MBCoverFlowView *)self.view setShowsScrollbar:YES];
+	
+	[NSThread detachNewThreadSelector:@selector(loadImages) toTarget:self withObject:nil];
 }
 
-- (void)dealloc
-{
-	[items release];
-	[super dealloc];
-}
-
-- (void)addItem:(id)sender
+- (void)loadImages
 {
-	/*if ([items isEqualToArray:[(MBCoverFlowView *)self.view content]]) {
-		return;
+	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+	NSMutableArray *images = [NSMutableArray array];
+	
+	NSString *file;
+	NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:@&quot;/Library/Desktop Pictures/Nature&quot;];
+	
+	int count = 0;
+	while ((file = [dirEnum nextObject])) 
+	{
+		NSImage *image = [[NSImage alloc] initWithContentsOfFile:[@&quot;/Library/Desktop Pictures/Nature&quot; stringByAppendingPathComponent:file]];
+		if (image != nil) {
+			// Scale down the image -- CoreAnimation doesn't like huge images
+			[image setSize:NSMakeSize([image size].width/2, [image size].height/2)];
+			NSDictionary *imageInfo = [NSDictionary dictionaryWithObjectsAndKeys:image, @&quot;image&quot;, file, @&quot;name&quot;, nil];
+			[images addObject:imageInfo];
+		}
+		[image release];
+		
+		[(MBCoverFlowView *)self.view performSelectorOnMainThread:@selector(setContent:) withObject:images waitUntilDone:NO];
+		
+		count++;
 	}
 	
-	NSArray *content = [items subarrayWithRange:NSMakeRange(0, [[(MBCoverFlowView *)self.view content] count]+1)];
-	[(MBCoverFlowView *)self.view setContent:content];*/
-	[(MBCoverFlowView *)self.view setContent:items];
+	[pool release];
 }
 
 @end</diff>
      <filename>MBCoverFlowViewController.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ce71fbe9acc1350c937885a6838859965f83a609</id>
    </parent>
  </parents>
  <author>
    <name>Matt Ball</name>
    <email>ball.matt@gmail.com</email>
  </author>
  <url>http://github.com/mattball/MBCoverFlowView/commit/1981f29e8a38750a5c5bfe61156e6c3ac9dfefed</url>
  <id>1981f29e8a38750a5c5bfe61156e6c3ac9dfefed</id>
  <committed-date>2009-04-29T13:10:14-07:00</committed-date>
  <authored-date>2009-04-29T13:10:14-07:00</authored-date>
  <message>* Fix sample project
* Include license file</message>
  <tree>5ac3e24381bc82a02777d4aedfe63a2db3e3a483</tree>
  <committer>
    <name>Matt Ball</name>
    <email>ball.matt@gmail.com</email>
  </committer>
</commit>
