Note that there are some explanatory texts on larger screens.

plurals
  1. PONSThread crashes on second call (iPhone)
    primarykey
    data
    text
    <p>I have an object and in that object I start my thread (for loading doing some URL loading).</p> <p>When I have a return of my data I call a selector to perform on the main thread.</p> <p>Works fine if I call it the first time, but the second time it crashes (no specific error).</p> <pre><code>[NSThread detachNewThreadSelector:@selector(doThread:) toTarget:self withObject:@"lala"]; -(void) doThread:(NSString *)poststring { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; DataModelLocator *mydelegate = [DataModelLocator instance]; NSData *postData = [poststring dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO]; NSURL *url = [NSURL URLWithString:[mydelegate fwaservicepath]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:url]; [request setHTTPMethod:@"POST"]; [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"]; [request setHTTPBody:postData]; NSURLResponse *urlResponse; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;urlResponse error:nil]; if(data) { [self performSelectorOnMainThread:@selector(loadDidFinishWithData:) withObject:data waitUntilDone:YES]; //[self loadDidFinishWithData:data]; } else { [self performSelectorOnMainThread:@selector(loadDidFinishWithError:) withObject:data waitUntilDone:YES]; } [pool release]; } } </code></pre> <p>It crashes when I call <code>performSelectorOnMaintThread</code>... Could it be that it crashes on a singleton, when it got released?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload