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