“An object 0x84be00 of class NSCFString is autorefined without a pool in place - just a leak” - but on the first line of the application!

In my iPhone application, I get three strange warnings in the console at the very beginning of the application, before any code was called at all:

*** __NSAutoreleaseNoPool(): Object 0x84be00 of class NSCFString autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x84b000 of class NSCFString autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x849c00 of class NSCFString autoreleased with no pool in place - just leaking

I use MBProgressHUD in several places to show progress indicators, as indicated by some of the other discussions of this issue, as it displays a new thread when the progress indicator is displayed. But the strangest thing is that they seem to rush before the start of my main function ():

int main(int argc, char *argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

NSAutoreleasePool, , , . , , , - ?

+3
5

, , main(), . / - __attribute__?


Herp.

. , . main(), GDB po 0x84be00 ( 0x84be00 , ).

, .

Derp.

__NSAutoreleaseNoPool , .

( , 18.27314 ).

+5

- , runloop. - :

static UIImage *myImage = [UIImage imageNamed:@"fred.png"];

, , - applicationDidFinishLaunching, .

, NSString , .

+2

, , :

-(void)myMethodThatRunsOnBackground:(id)param {
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

  //body of method

  [pool release];
}

answer credit: nobre84 iphonedevsdk.com

+2

, , . , , main, , + (void) load, , , , . , , , , main. , . myload .

+2

, , .

0

All Articles