Singleton array deallocated? EXC_BAD_ACCESS
- by lclaud
Ok, so I have this singleton object and in it is an array that needs to be shown in a tableview.
The thing is that it deallocates and after the first show, i get EXC_BAD_ACCESS in cellForRowAtIndexPath
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [[dataBase shareddataBase].dateActive count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"celula"];
int i;
i=indexPath.row;
if (cell==nil) {
cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"celula"];
}
count sent to dealocated instance of CFArray .. in cellForRowAtIndexPath..
WHAT is deallocating it? why?
it's declarea as an NSMutableArray and has a (nonatomic,retain) property defined ..
if ((i<[[dataBase shareddataBase].dateActive count])&&(i>=0)) {
NSDictionary *d=[[dataBase shareddataBase].dateActive objectAtIndex:i];
cell.textLabel.text=[d objectForKey:@"detaliu"];
}
return cell;
}