के साथ असीमित NSRL कनेक्शन, मैं पृष्ठभूमि मोड में NSURLConnection
करना चाहता हूं, क्योंकि प्रतिक्रिया में बहुत अधिक डेटा है। फ़ोरम didEnterBackground
में उपयोग करने के लिए ऐप्पल की सीमित लंबाई कोडिंग का उपयोग करने के लिए कह रहे हैं। लेकिन मैं इसे से बचाना चाहता हूं। इसके बाद मैं NSOperation
के माध्यम से NSInvocation
के साथ निम्नलिखित कोड का उपयोग करता हूं, लेकिन यह काम नहीं कर रहा है। connectToServer
NSURLConnection
ऑपरेशन है। कृपया मदद करें? didReceiveData
, didReceiveResponse
प्रतिनिधि विधियों को नहीं कहा जाता है? कतार: completionHandler: sendAsynchronousRequest परNSOperation
NSOperationQueue *queue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
selector:@selector(connectToServer)
object:nil];
[queue addOperation:operation];
[operation release];
[queue autorelease];
-(void)connectToServer
{
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSURLConnection *theConnection = [[[NSURLConnection alloc] initWithRequest:theRequest delegate:self] autorelease];
if(theConnection)
{
webData = [[NSMutableData data] retain];
}
else
{
NSLog(@"theConnection is NULL");
}
}
आपका प्रश्न स्पष्ट नहीं है –
कृपया मेरा संपादित प्रश्न देखें? – nameless