Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moverequest doesn't trigger delegate @ didReceiveAuthenticationChalleng and connectionDidFinishLoading. #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iPad/AppDelegate_iPad.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @implementation AppDelegate_iPad
#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Override point for customization after application launch.
ACSugarSyncClient* client = [ACSugarSyncClient clientWithUsername:@"[email protected]" password:@"spoon!08" accessKey:@"MTY0OTE1ODEzMTM1MzU1NTYxNjg" privateAccessKey:@"MmFhYzljN2RlOGQ0NDA5YWE1NDNlYTA0Yzk2MDk5N2Q"];
Expand Down Expand Up @@ -52,8 +52,8 @@ -(void)test:(id)value {
ACSugarSyncFile* file = (ACSugarSyncFile*)item;
NSLog(@"File: %@ - %d bytes", file, file.size);
if(file.size > 0) {
// [file downloadFile];
// break;
// [file downloadFile];
// break;
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/ACWebDAV/Requests/ACWebDAVMoveRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,26 @@ -(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChalleng

- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSHTTPURLResponse*)response {
if([response statusCode] == 201) {
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(ACWebDAVMoveRequest:didMoveItem:)]) {
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(request:didMoveItem:)]) {
ACWebDAVLocation* newLocation = [ACWebDAVLocation locationWithURL:[response URL] username:self.location.username password:self.location.password];
ACWebDAVItem* item = [[ACWebDAVItem alloc] initWithLocation:newLocation];
[self.delegate request:self didMoveItem:item];
[item release];
}
} else {
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(ACWebDAVMoveRequest:didFailWithErrorCode:)]) {
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(request:didFailWithErrorCode:)]) {
[self.delegate request:self didFailWithErrorCode:[response statusCode]];
}
}
}

-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[connection release];
}

-(void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(ACWebDAVMoveRequest:didFailWithError:)]) {
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(request:didFailWithError:)]) {
[self.delegate request:self didFailWithError:error];
}
[connection release];
Expand Down
4 changes: 4 additions & 0 deletions src/ACWebDAV/Requests/ACWebDAVPropertyRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ -(void)connectionDidFinishLoading:(NSURLConnection *)connection {

-(void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
if(self.delegate != nil && [(NSObject*)self.delegate respondsToSelector:@selector(request:didFailWithError:)]) {
[self.delegate request:self didFailWithError:error];
}

[connection release];
}

Expand Down