I have a section of my code which calls a method returning an NSMutableArray like so:
+(NSMutableArray *)method {
NSMutableArray *rgb = [[NSMutableArray alloc] initWithObjects:....., nil];
return rgb;
}
It gives me a leak every time it’s called. Putting [rgb release]; after return doesn’t appear to work. Putting it before return makes my app crash. Also putting in an autorelease makes my app crash. Suggestions?
Alternatively:
IF this still crashes, then the problem is most likely outside of that method, not within.