Below code shows up a memory leak , when profiling.
ContentViewController *dataViewController;
dataViewController = [[ContentViewController alloc]initWithNibName:@"ContentViewController" bundle:nil];
dataViewController.DocumentPath = [self.modelArray objectAtIndex:index];
return dataViewController;
How can i solve this leak, Any idea please help me.
If you are not using ARC.
Whenever you return an object from method, Return an autoreleased object:
I’ll suggest using ARC is a good option. Because it’s much better than manual memory management. ARC is a compile time feature, it’ll add retain, release calls for you automatically when you compile your source code.