Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:13:00+00:00 2026-05-15T21:13:00+00:00

I call a function with performSelectorInBackground, and in this function, I declare NSAutoreleasePool *pool

  • 0

I call a function with performSelectorInBackground, and in this function, I declare

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

at the beginning

[pool release];         

at the end

But in the console, I have this message:

2010-07-23 10:58:30.277 ProjetMission[5914:6913] void _WebThreadLockFromAnyThread(bool), 0x5d5c770: Obtaining the web lock from a thread other than the main thread or the web thread. UIKit should not be called from a secondary thread.

Why? Because if I don’t put a nsautoreasepool in my function I have a lot of message like this:

2010-07-23 11:02:58.667 ProjetMission[5951:660f] *** __NSAutoreleaseNoPool(): Object 0x5a7c560 of class NSCFString autoreleased with no pool in place - just leaking

thanks for your help

-(void) telechargerDossierWebDansThread
{

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSString *nomFichier;
    int i;
    BOOL dossierExiste = FALSE;
    int y;
    NSString *reponse;

    NSArray *listeFichier = [self listeFichierATelecharger:[dossierWeb stringByAppendingString:@"/fichier-a-downloader.txt"]];

    [textView performSelectorOnMainThread:@selector(setText:) withObject:@"" waitUntilDone:YES];

    [textView performSelectorOnMainThread:@selector(setText:) withObject:[FonctionUtile concatener: @"Sommaire du download pour le circuit-" chaine2:nomCircuit chaine3:@"" chaine4:@"\n"] waitUntilDone:YES];
    [textView performSelectorOnMainThread:@selector(setText:) withObject:[FonctionUtile concatener:textView.text chaine2:@"Nombre de fichier à downloader => " chaine3:[NSString stringWithFormat:@"%d", [listeFichier count]]  chaine4:@"\n"] waitUntilDone:YES]; 

    if ([listeFichier count] > 0) 
    {

        if ([ManipulationFichierDossier supprimerDossierFichier:cheminDossierSurIpod] || ![ManipulationFichierDossier VerifierSiDossierFichierExiste:cheminDossierSurIpod] ) {
            dossierExiste =  [ManipulationFichierDossier creerDossier:cheminDossierSurIpod];
        }

        if (dossierExiste)
        {

            [textView performSelectorOnMainThread:@selector(setText:) withObject:[FonctionUtile concatener:textView.text chaine2:[FonctionUtile padderChaine:@"Fichiers à downloader" :27 :@" " :TRUE] chaine3:@"Download succès" chaine4:@"\n" ] waitUntilDone:YES];

            y = 70;

            for (i = 0; i < [listeFichier count]; i++)
            {
                nomFichier = [[listeFichier objectAtIndex:i]retain];

                if ([self TelechargerFichierUnique:nomFichier :[FonctionUtile concatener:dossierWeb chaine2:@"/" chaine3:nomFichier chaine4:@""] :cheminDossierSurIpod :TRUE])
                {

                    reponse = @"Oui";
                }
                else                  
                {
                    reponse = @"Non";
                }

                [textView performSelectorOnMainThread:@selector(setText:) withObject:[FonctionUtile concatener:textView.text chaine2:[FonctionUtile padderChaine:nomFichier :27 :@" " :TRUE] chaine3:reponse chaine4:@"\n"] waitUntilDone:YES];

                y = y +20;
            }
        }
    }

    [textView performSelectorOnMainThread:@selector(setText:) withObject:[FonctionUtile concatener:textView.text chaine2: @"Fin du download pour le circuit-" chaine3:nomCircuit chaine4:@""] waitUntilDone:YES];

    [pool release];
}

and this function is call by performSelectorInBackground.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:13:00+00:00Added an answer on May 15, 2026 at 9:13 pm

    Having the NSAutoreleasePool is correct. The error message just seems to indicate that you’re manipulating a UI element (a UIWebView, perhaps) from the background thread. As the error message says, this is not A Good Thing™.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 492k
  • Answers 492k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See here: How to select distinct rows in a datatable… May 16, 2026 at 10:20 am
  • Editorial Team
    Editorial Team added an answer To answer this question, you can compute a TF-IDF weighted… May 16, 2026 at 10:20 am
  • Editorial Team
    Editorial Team added an answer You would use a where statement, as Lazarus describes. If… May 16, 2026 at 10:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I want to call a c# function from my javascript function. I have a
I have a JavaScript function which i call in the onchange handler of a
I am trying to call my function named isUrgencyTypeValid from my javascript code but
We have a VB.NET program that needs to periodically call a function in an
In Javascript we can declare a variable and we can call a function. The
I can't figure out the prototype for this simple function: In stack: Function call:
How do you call function lol() from outside the $(document).ready() for example: $(document).ready(function(){ function
I want to call function with arguement periodically. I tried setTimeout(fnName(),timeinseconds) ; and it
How to call function of just created object without temporary variable? Code (new \Foo())->woof();
Is it possible to call function-like-macros with less that all the parameters in linux?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.