local declaration hides instance variable message popup near “self.treatmentId = treatmentId;” and “self.treatmentName = treatmentName;”;
@implementation Treatment
@synthesize treatmentId;
@synthesize treatmentName;
-(Treatment *)initWithtreatmentName:(NSString *)treatmentName treatmentId:(NSString *)treatmentId{
if((self = [super init])){
self.treatmentId = treatmentId;
self.treatmentName = treatmentName;
}
return self;
}
@end
Change your code to the following.
By declaring the local variable
trentmentNameandtreatmentIdyou are essentially losing the ability to access the global (iVars) via their names.