Permalink
Browse files

Adding testing

  • Loading branch information...
1 parent 9fec263 commit c098c92c2bd4f59cf7441e49510d9086d6778a20 Marcus S. Zarra committed Mar 29, 2011
Showing with 21 additions and 2 deletions.
  1. +21 −1 AssetManagerTest/Classes/AppDelegate.m
  2. +0 −1 ZSURLConnectionDelegate.m
@@ -28,6 +28,9 @@
#import "AppDelegate.h"
#import "RootViewController.h"
+#import "ZSURLConnectionDelegate.h"
+
+#define kFeedHREF @"http://api.flickr.com/services/feeds/groups_pool.gne?id=1621520@N24&lang=en-us&format=rss_200"
@implementation AppDelegate
@@ -47,8 +50,25 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N
[[self window] addSubview:[[self navigationController] view]];
[[self window] makeKeyAndVisible];
- return YES;
+ NSURL *feedURL = [NSURL URLWithString:kFeedHREF];
+ ZSURLConnectionDelegate *delegate = [[ZSURLConnectionDelegate alloc] initWithURL:feedURL delegate:self];
+ [delegate setSuccessSelector:@selector(feedDownloadSuccessful:)];
+ [delegate setFailureSelector:@selector(feedDownloadFailure:)];
+ [[NSOperationQueue mainQueue] addOperation:delegate];
+ MCRelease(delegate);
+
+ return YES;
+}
+
+- (void)feedDownloadSuccessful:(ZSURLConnectionDelegate*)delegate
+{
+ DLog(@"success!");
+}
+
+- (void)feedDownloadFailure:(NSError*)error
+{
+ ALog(@"Failure: %@", error);
}
@end
@@ -166,7 +166,6 @@ - (void)connectionDidFinishLoading:(NSURLConnection*)connection
[self setDuration:([NSDate timeIntervalSinceReferenceDate] - [self startTime])];
if (![self filePath]) { // MSZ: Backward compatibility
- DLog(@"Elfred To Remove - This is being used");
if ([[self delegate] respondsToSelector:[self successSelector]]) {
[[self delegate] performSelectorOnMainThread:[self successSelector] withObject:self waitUntilDone:YES];
}

0 comments on commit c098c92

Please sign in to comment.