mutualmobile / MMSpreadsheetView

MIT License
193 stars 34 forks source link

index 0,0 never being called for cell creation #15

Closed ITDebicki closed 10 years ago

ITDebicki commented 10 years ago

I have been struggling with this for a while, but since I moved my project into Xcode 6 gm, I have been having trouble that no cells for the collection view with tag '1' are being initialised (Top left collection view). I have also downloaded he demo project and compiled it in Xcode 6, and the top left cell appears correctly. My initialisation code for the spreadsheet is nearly identical, with the only difference being the size. I have also checked that the collection view is being created, which it is, however the cell is not. Any advice or ideas why this error night be occurring?

jeffla commented 10 years ago

I just created a new project with XC6GM, installed the pod and copied the demo classes for the three cells. In the demo, that MMGridCell displays a logo so you'd also need to include the image in your project. I removed the image and added gc.textLabel.text = @"Blah";, and when I run it, I see Blah in the cell.

If you have named your classes differently, you do need to register them with [spreadSheetView registerCellClass:[MMGridCell class] forCellWithReuseIdentifier:@"GridCell"]; as I do in viewDidLoad in the demo.

ITDebicki commented 10 years ago

I understand how the cell registration works and register the cell correctly, and it is not an issue with the actual content of the cell, as when I hard code the cell to appear, it appears correctly. I also know the demo appears correctly as I have tested that as well. From what I have managed to debug in the code, it is an issue with the Upperleftcollectionview not containing a cell (checked with layers inspector) I'll keep trying today to go d the root of the problem, and I'll post here if I manage to solve it.

ITDebicki commented 10 years ago

Finally managed to find a solution, albeit a weird one. I did it by going into the storyboard, and adding another UIView on top of the default view o that view controller