I have declared an array in viewDidLoad.
-(void) viewDidLoad{
status=[[NSMutableArray alloc] init];
[status addObject:@"Pending"];
}
Now in some function I need to change the value of "Pending" to "Approved". and then check that condition in cellforRow. What I am currently doing is :
some function: [[ objectAtIndex:0] addObject: "Approved"];
cellForRow:
if( [[status objectAtIndex:0] isEqual:@"Pending"){
//do this
}
else if ([[status objectAtIndex:0] isEqual:@"Approved"){
//do that
}
It is throwing an exception:
NSInvalidArgumentException :[__ NSCFCConstantString addObject:]: unrecognized selector sent to instance