Hi, this is the Code I write to read the sprite sheet and generate Animation.
Am I doing the right thing in terms of Memory Management?
Is it the right way to use NSAutoreleasePool?
Right now, I am puting NSAutoreleasePool in each if statement...
if(movingSpriteSheetFileName != nil && movingSpriteSheetFileName != @"")
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString* plistPath = [[NSBundle mainBundle] pathForResource:movingSpriteSheetFileName ofType:@""];
NSDictionary *plistDictionary = [NSDictionary dictionaryWithContentsOfFile:plistPath];
NSArray* keysArray = [plistDictionary allKeys];
..................................
// [animation release];
//[plistPath release];
// [plistDictionary release];
// [keysArray release];
[pool release];
}
By the way,
Why I can't call
[plistPath release];
[plistDictionary release];
[keysArray release];
At the end of the If Statement?
It kind of crashes if I do so..
Thanks for answering.