I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow:
I created a NSMutableArray
: NSMutableArray *myArray = [[NSMutableArray alloc]init];
Then I populated it form a database MyObj *obj = [[MyObj alloc]initWithName:idObj];
When I show the values in the tableview cellForRowAtIndexPath:
method everything goes fine, but when I try to load the same array in the didSelectRowAtIndexPath:
method, the values in the arrays are "invalid".
The NSMutableArray
declaration is as follow:
@property (nonatomic, retain) NSMutableArray *myArray;
Here is the code:
.h file
NSMutableArray *antrosArray;
@property(nonatomic, retain) NSMutableArray *antrosArray;
.m file
@synthesize antrosArray;
//filling the array:
Antro *antro = [[Antro alloc]initWithName:idAntro nombre:aName];
[self.antrosArray addObject:antro];
my problem is:
when I access the array from the cellForRowAtIndexPath:
tableView methods, everything goes ok, but when the user selects a record I tried to read the array in the didSelectRowAtIndexPath:
method and all the values in my array are invalid.
The array is there, and also the object, but the values for the objects are empty, the cellForRowAtIndexPath:
method is cleaning the array.