You will want to set the class (class A) as the delegate of the class that is actually triggering the http requests (class B). You create an instance of the method of class B, call your method, and have your method send a notification and/or response back to class A.
Something along the lines of:
Class A:
if(bwebservice == nil){
bwebservice = [[WebServiceClass alloc] initWithDelegate:self];
}
[bwebservice start];
.
.
.
#pragma mark - Web Service Methods
- (void)webService:(WebServiceClass *)webService didFailWithError:(NSError *)error{
NSLog(@"ERROR: %@", error);
}
- (void)webServiceDidComplete:(JSONService *)webService{
}
Class B:
// ...REQUEST SEND DATA...
.
.
.
- (void)notifyDelegateOfError:(NSError *)error{
[delegate webService:self didFailWithError: error];
}
- (void)notifyDelegateOfCompletion
{
if ([delegate respondsToSelector:@selector(webServiceDidComplete:)]) {
[delegate webServiceDidComplete:self];
}
}
solved Make a call from one class to another and receive its return response [closed]