Comments (5)
Has this just happened with the last version that was pushed or did the problem occur in previous versions? Cheers.
from dtgridview.
Hi,
I'm using the latest code version.
I also noticed that I can reloadData without problem when going from 1 row of multiple columns (horizontal) to 1 column of multiple rows (vertical) but an exception is thrown when going the other way.
* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSMutableArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
The problem is at:
- (void)checkViews {
...
// Line 446
if ([[self.gridCells objectAtIndex:info.yPosition] count] - 1 > info.xPosition && info.frame.origin.x + info.frame.size.width < self.contentOffset.x + self.frame.size.width)
...
}
Jeff
from dtgridview.
Ran into this also with the latest version. A simple fix that seems to work is to add the line [cellInfoForCellsOnScreen removeAllObjects]; to initializeViews at line 534 just after the first for loop. See below:
- (void)initialiseViews {
for (NSInteger i = 0; i < [cellInfoForCellsOnScreen count]; i++) {
DTGridViewCellInfo *info = [cellInfoForCellsOnScreen objectAtIndex:i];
if (![self cellInfoShouldBeOnShow:info])
[self removeCellWithInfo:info];
}
//Eric fix for issue with rotation of DTGridView to a table with a different number of rows or columns.
//Not sure if this should be the final fix, but it is working for now.
[cellInfoForCellsOnScreen removeAllObjects];
for (NSInteger i = 0; i < [gridCells count]; i++) {
from dtgridview.
I worked around this by adding a range check:
} else if (isGoingRight) {
// check bounds
if (info.yPosition < [self.gridCells count])
{
if ([[self.gridCells objectAtIndex:info.yPosition] count] - 1 > info.xPosition && info.frame.origin.x + info.frame.size.width < self.contentOffset.x + self.frame.size.width) {
if (![leftRightCells objectForKey:[NSString stringWithFormat:@"%i", info.yPosition]])
[leftRightCells setObject:info forKey:[NSString stringWithFormat:@"%i", info.yPosition]];
else if ([[leftRightCells objectForKey:[NSString stringWithFormat:@"%i", info.yPosition]] xPosition] < info.xPosition)
[leftRightCells setObject:info forKey:[NSString stringWithFormat:@"%i", info.yPosition]];
}
}
}
from dtgridview.
This happens for me as well on the current version - it happens when you remove a column, but not when you add one. Any thoughts on what makes for a performant workaround?
from dtgridview.
Related Issues (11)
- Crash in removeCellWithInfo
- Fixed column on left hand side HOT 1
- spacingBetweenRowsInGridView and spacingBetweenColumnsInGridView are not used
- reloadData removes all cells and doesn't add any back HOT 3
- Reload table
- spacingBetweenColumnsInGridView method never get called
- DTInfiniteGridViewExampleViewController not infinite scroll HOT 1
- DTGridView shows lot of memory leaks in loaddata function can you please look into it . thanks HOT 2
- Cells in last row never get requested HOT 2
- reloadData Issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtgridview.