Dealloc is not called even after release. Here is my code for initialization.
@interface PPTileMap : CCTMXTiledMap
{
}
@end
@implementation PPTileMap
-(void)dealloc
{
printf("Dealloc called\n");
}
@end
//allocation
PPTileMap *tileMap = [[PPTileMap alloc] initWithTMXFile:tilemapFile];
//release
[tileMap release];
tileMap = nil;
When I use tiledMapWithTMXFile then it will..but crashes after loading thread.
Why dealloc is not called for above code?
The only reason that
dealocis not called after sendingreleasethat the object is retained by someone else (added to NSArray or NSDictionary, retained by one of your objects, you have run action on it, etc.). If you don’t know, what object retains your object, override it’sretainmethod asThen place breakpoint inside this method. Then you will be able to see the call stack every time something want to retain your object. You can also override
releasemethod