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

  • SEARCH
  • Home
  • 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 520711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:10:26+00:00 2026-05-13T08:10:26+00:00

Object 0x3d58870 of class NSCFString autoreleased with no pool in place – just leaking

  • 0

Object 0x3d58870 of class NSCFString autoreleased with no pool in place – just leaking

I’m receiving this memory warning for almost all variables used in the following function:

- (void) backgroundTask {

c= [array1 count];
if (c == 0){
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"ERROR" message:@"Chose an image to upload!!!" delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil];
    [alert show];
    [alert release];
}
else {  
    for(k==0;k<c;k++){
        [uploading startAnimating];

        upload = [array1 objectAtIndex:0];
        NSData *imageData = UIImageJPEGRepresentation(upload, .9);      
        NSString *urlString = @"http://fileserver.colormailer.com/fileserver/photoService?method=addPhoto&description=testingupload&albumId=nithinalbum&userId=123nithin&sid=12345678&title=image125";

        NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
        [request setURL:[NSURL URLWithString:urlString]];
        [request setHTTPMethod:@"POST"];

        NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
        NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
        [request addValue:contentType forHTTPHeaderField:@"Content-Type"];

        NSMutableData *body = [NSMutableData data];
        [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
        [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"userfile\"; filename=\".jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
        [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
        [body appendData:[NSData dataWithData:imageData]];
        [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
        [request setHTTPBody:body];

        msg = [[NSString alloc]initWithFormat:@"Upload number %d",a];
        NSLog(msg);
        NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
        NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];

        NSLog(returnString);
        a++;
        [returnString release];
        [array1 removeObjectAtIndex:0];

    }
    [uploading stopAnimating];
    if(c == 1){
        msg = [[NSString alloc]initWithFormat: @"1 image uploaded"];
    }
    else{
        msg = [[NSString alloc]initWithFormat: @"%d images uploaded",c];
    }
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"upload success" message:msg delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil];
    [alert show];
    [msg release];
    [alert release];
}
}

I’m calling this function as:

- (IBAction)pushUpload {
    [self performSelectorInBackground:@selector(backgroundTask) withObject:nil];
}

When I used the tasks inside the former function directly in the Action method, there were no problems, but it came for this step.
The aforementioned warnings are shown in the console.
They come for NSData, NSString, NSMutableArray, and everything I’ve initiated in this function…

  • 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-13T08:10:26+00:00Added an answer on May 13, 2026 at 8:10 am

    If you’re allocating autoreleased objects in a background thread you’ll need to create an autorelease pool:

    pool = [[NSAutoreleasePool alloc] init];
    
    // Your code with autoreleased objects
    
    [pool release]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Object doesn't support this property or method It's this line. pthumb = $(#pthumb).attr(src); Does
object ReassignTest extends App { class X(var i : Int) def x = new
object here should refer to the Object class. As with all class identifiers in
In Object Oriented when I create a class variable and initialize it in my
Good object-oriented design says that objects should not expose their internals. Given this is
Object reference not set to an instance of an object. i am getting this
Object o = new Long[0] System.out.println( o.getClass().isArray() ) System.out.println( o.getClass().getName() ) Class ofArray =
object obj = new object[] { new object(), new object() }; How does this
Object Class: class User{ public String name; public String password; } JSON: { sc:200,
Object[] array = new Object[]{}; System.out.println((array instanceof Serializable));//passed System.out.println((array instanceof Cloneable));//passed This code compiles

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.