Question

I want to use the auto-release in my apps. I want to implement this methods get by  analyze

- (void)selectorConnect: (NSArray *)args
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    //some code 

    [pool release];
}

Getting crash at [pool release] line. Any solution for that .

Was it helpful?

Solution

When you empty an autorelease pool, it calls autorelease on all objects inside it.

If you're getting a crash with the [pool release] line then you've added an object to the autorelease pool and have released it yourself.

Run the static analyser and see what warnings it gives you.

And if you still don't know, enable NSZombies and see what object is being released twice.

Finally, if that still doesn't help, add your code to the question and we can all take a look :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top