1
0
Fork 0
master
Matthieu Lalonde 14 years ago
parent f4dfc568e1
commit d04a5a192c

@ -84,8 +84,8 @@
- (void) getStatusUpdate:(NSString*)uri delegate:(id)requestDelegate callback:(SEL)requestSelector - (void) getStatusUpdate:(NSString*)uri delegate:(id)requestDelegate callback:(SEL)requestSelector
{ {
self.delegate = requestDelegate; delegate = requestDelegate;
self.callback = requestSelector; callback = requestSelector;
theConnection = [[NSURLConnection alloc] initWithRequest:[self buildRequest: uri] delegate:self]; theConnection = [[NSURLConnection alloc] initWithRequest:[self buildRequest: uri] delegate:self];
@ -121,6 +121,7 @@
startRange = [stringData rangeOfString:key]; startRange = [stringData rangeOfString:key];
stringData = [stringData substringFromIndex:(startRange.location + [key length])]; stringData = [stringData substringFromIndex:(startRange.location + [key length])];
NSRange endRange = [stringData rangeOfString:@"\""]; NSRange endRange = [stringData rangeOfString:@"\""];
[self setWanPort:[stringData substringToIndex:endRange.location]]; [self setWanPort:[stringData substringToIndex:endRange.location]];
[self setWrtReachable:true]; [self setWrtReachable:true];
} else { } else {
@ -324,8 +325,8 @@
if (errorCallback) { if (errorCallback) {
[delegate performSelector:errorCallback withObject:error]; [delegate performSelector:errorCallback withObject:error];
} else if (delegate && callback) { } else if (delegate && callback) {
if ([delegate respondsToSelector:self.callback]) { if ([delegate respondsToSelector:callback]) {
[delegate performSelector:self.callback withObject:nil]; [delegate performSelector:callback withObject:nil];
} }
} }
} }
@ -335,8 +336,8 @@
//NSLog(@"5"); //NSLog(@"5");
// TODO: Return the data // TODO: Return the data
if (delegate && callback) { if (delegate && callback) {
if ([delegate respondsToSelector:self.callback]) { if ([delegate respondsToSelector:callback]) {
[delegate performSelector:self.callback withObject:receivedData]; [delegate performSelector:callback withObject:receivedData];
} else { } else {
// TODO: Return no data // TODO: Return no data
NSLog(@"No response data from delegate"); NSLog(@"No response data from delegate");

Loading…
Cancel
Save