Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding testing

  • Loading branch information...
commit c098c92c2bd4f59cf7441e49510d9086d6778a20 1 parent 9fec263
Marcus S. Zarra authored
View
22 AssetManagerTest/Classes/AppDelegate.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
View
1  ZSURLConnectionDelegate.m
@@ -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];
}
Please sign in to comment.
Something went wrong with that request. Please try again.