I have this variable defined here:
const SDataGridCoord *clickedGridCoord;
and I am populating it in this method:
- (void)shinobiDataGrid:(ShinobiDataGrid *)grid willSelectCellAtCoordinate:(const SDataGridCoord *)gridCoordinate
{
if ((gridCoordinate.column.displayIndex==5||gridCoordinate.column.displayIndex == 6 || gridCoordinate.column.displayIndex == 7 ) && dataSource.dataForDatabase)
{
clickedGridCoord = gridCoordinate;
[self CreateCellDateModPopup:gridCoordinate];
}
}
and I used a break point and see its being populated.
But when I goto call it, its empty:
CellData *cell = [dataSource.cellHolder objectAtIndex:clickedGridCoord.row];
and by empty I mean there is no row or column, but there is when I first populate the SDataGridCoord.
What am I doing wrong, there is nothing else that is overriding the variable.
I have tried this:
SDataGridCoord *clickedGridCoord;
then
- (void)shinobiDataGrid:(ShinobiDataGrid *)grid willSelectCellAtCoordinate:(const SDataGridCoord *)gridCoordinate
{
if ((gridCoordinate.column.displayIndex==5||gridCoordinate.column.displayIndex == 6 || gridCoordinate.column.displayIndex == 7 ) && dataSource.dataForDatabase)
{
clickedGridCoord = (SDataGridCoord *)gridCoordinate;
[self CreateCellDateModPopup:gridCoordinate];
}
}
still same result and my app still crashes: Thread 1:EXC_BAD_ACCESS (code = 1, address=0xc000000c)
My .m file:
@interface Controller()
{
SDataGridCoord *clickedGridCoord;
}
@implementation Controller
- (void)shinobiDataGrid:(ShinobiDataGrid *)grid willSelectCellAtCoordinate:(const SDataGridCoord *)gridCoordinate
{
if ((gridCoordinate.column.displayIndex==5||gridCoordinate.column.displayIndex == 6 || gridCoordinate.column.displayIndex == 7 ) && dataSource.dataForDatabase)
{
clickedGridCoord = (SDataGridCoord *)gridCoordinate;
[self CreateCellDateModPopup:clickedGridCoord];
}
}
- (void)ChangeCellWithStringDate :(NSString *)stringDate
{
//My app crashes here with this error: Thread 1:EXC_BAD_ACCESS (code = 1, address=0xc000000c)
CellData *cell = [dataSource.cellHolder objectAtIndex:clickedGridCoord.row.rowIndex];
}