If I create an NSObject class with a method that returns an NSMutableArray do I need to release the array inside the class or does the Class never retain?
Not sure on how to explain so here is some code:
@implementation PointsClass
- (NSMutableArray *)pointsForLevel
{
NSMutableArray *_points = [NSMutableArray new];
[_points addObject:[NSValue valueWithCGPoint:CGPointMake(521, 279)]];
[_points addObject:[NSValue valueWithCGPoint:CGPointMake(321, 491)]];
[_points addObject:[NSValue valueWithCGPoint:CGPointMake(419, 477)]];
return _points;
}
@end
If i call this method from a ViewController like this:
PointsClass *pointsClass = [PointsClass new];
NSMutableArray *points = [pointsClass pointsForLevel];
[pointsClass release];
Do I only need to release the pointers Array? Has the _points array been retained at all?