I'm working with creating my own custom view templates programmatically for the app I'm working on. To achieve this i have a custom view controller MyVC with a a custom view myView added on to it which is a property of MyVC. The class looks something like this:

Now when i analyze my code i get a 'potential leak of an object' message when i assign the color. Is it because myView or the background color or both are being retained?
In any case id like to know how this can be done correctly without potential leaks?

I've overWritten the -(id)initWithFrame:(CGRect)frame method in the 'MyCustomView' class. So i call that in viewDidLoad in my ViewController like so: self.myView = [[MyCustomView alloc] initWithFrame:someFrame];
–
SagarOct 16 '12 at 7:09