I have the following controller class which will do different tasks based on combination of the flag and param property. The value of these two properties will be set by many other classes having a reference to this controller. The question is how does each of the calling class assign value and when should they release it so that there will be no memory leak ?
@interface SampleController {
NSMutableArray *param;
NSString *flag;
}
@property (nonatomic, retain) NSMutableArray *param;
@property (nonatomic, retain) NSString *flag;
@end
@implementation SampleController
@synthesize param;
@synthesize flag;
- (id)init
{
param = [[NSMutableArray alloc] initWithCapacity:0];
flag = @"nothing";
}
@end