I am using following code to create NSMutableArray. When I run the same in “Profile” mode, it is showing a memory leakage.
SampleArray.h
@interface SampleArray: NSObject {
}
@property (assign, retain) NSMutableArray *array;
@end
SampleArray.m
#import "SampleArray.h"
@implementation SampleArray
@synthesize array;
-(void) viewDidLoad {
self.array =[ [NSMutableArray alloc] init];
}
-(void) viewWillDisappear:(BOOL)animated {
[self.array release];
}
@end
When I am using autorelease, then I can’t able to access the same in other function or method and return null value. Please help me to find the issue.