i need to know is it possible to call json webservices from background, when the user press the home button, i am calling this method from background execution
- (void) runTimer
{
[NSThread detachNewThreadSelector:@selector(updateAllVisibleElements)toTarget:self withObject:nil];
}
- (void) updateAllVisibleElements {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if(service == nil)
{
service = [[WebService alloc] init];
}
[service getlocationID:currentLatitude andlongitude:currentLongitute];
[pool release];
}
and in called the function [service getlocation id] however after that it doesn’t show any response or data recieves and app terminates, plz help me
Note that you never test that
serviceis a good value (not nil) before you make the call