2011-03-12 4 views
0

Je reçois le journal de plantage ci-dessous dans mon code iphone et je ne suis pas capable de comprendre ce que je fais à tort ou comment y remédier.URLconnection explication de journal de panne requise

Votre aide serait vraiment aider mon application :)

0 0x03256c97 in objc_msgSend() 
1 0x000005c3 in ??() 
2 0x02ae7dd9 in URLConnectionClient::_clientDidFinishLoading() 
3 0x02b5b1aa in URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload() 
4 0x02adbdf0 in URLConnectionClient::processEvents() 
5 0x02adbc7a in MultiplexerSource::perform() 
6 0x030765fa in CFRunLoopRunSpecific() 
7 0x030758a8 in CFRunLoopRunInMode() 
8 0x0355c89d in GSEventRunModal() 
9 0x0355c962 in GSEventRun() 
10 0x004c5372 in UIApplicationMain() 

Voici l'extrait d'où je commence la connexion

@interface HttpConnection : NSObject { 
    NSMutableURLRequest *urlRequest; 
    NSURL *nstrUrl; 
    NSMutableData *receivedData; 
    NSURLConnection *urlConnection; 
} 
@property (retain)NSMutableData *receivedData; 
@property (retain)NSURL *nstrUrl; 
@property (retain)NSMutableURLRequest *urlRequest; 

@implementation HttpConnection 
    @synthesize receivedData; 
    @synthesize nstrUrl; 
    @synthesize urlRequest; 

    NSAutoreleasePool *lpool=[[NSAutoreleasePool alloc] init]; 

     nstrUrl = [NSURL URLWithString:url]; 
    [UIApplication sharedApplication].networkActivityIndicatorVisible=YES; 
    urlRequest = [NSMutableURLRequest requestWithURL:nstrUrl cachePolicy: NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:TIMEOUT_INTERVAL]; 
    [urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; 
    urlConnection = [[NSURLConnection alloc]initWithRequest:urlRequest delegate:self startImmediately:YES]; 

    if (urlConnection) { 
     self.receivedData = [[NSMutableData alloc]init]; 
    } 
    else { 
     NSLog(@"Connection Not Established"); 
     // inform the user that the download could not be made 
    } 
    [lpool release]; 

et voici comment je libérer l'objet de connexion dans connectionDidFinishLoading

[receivedData release]; 
receivedData=nil; 
[urlConnection release]; 
urlConnection=nil; 
+0

Utilisez-vous @synthesize et @property pour vos variables? – phi

+0

J'ai utilisé synthétiser comme suit: @synthesize receivedData; @synthesize nstrUrl; @synthesize urlRequest; – Anand

+0

Il me semble que vous relâchez trop l'instance HttpConnection – Max

Répondre

0

Il ne semble pas que HTTPConnection ait une super-classe. Par exemple:

@interface HttpConnection: CPObject

Je ne sais pas si cela cause de votre accident ou non.

+0

Désolé je viens de mettre l'extrait .. Il a la superclasse: NSObject – Anand

Questions connexes