-
Notifications
You must be signed in to change notification settings - Fork 2.2k
ASTableView Section Header Cell does not render subNode in App Store build #277
Comments
I created a repo: https://github.com/ulfie22/SectionHeaderTest with a project that demonstrates this issue. I will be happy to add you as an internal tester in TestFlight if you want to see the App Store version of the app. Thank you for your help. |
Hm, interesting! Let's take a look.
This is because you never call I'd start by modifying your delegate method to look more like this: - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
SKMenuSection *sect = [_menu.sections objectAtIndex:section];
TableHeaderNode *node = [[TableHeaderNode alloc] initWithTitle:sect.title];
[node measure:CGSizeMake(tableView.bounds.size.width, FLT_MAX)];
return node.view;
} You can then remove the duplicate work from TableHeaderNode's layout implementation: - (void)layout
{
CGPoint textOrigin = CGPointMake(kOuterPadding, kOuterPadding);
_textNode.frame = (CGRect){ .origin = textOrigin, .size = _textNode.calculatedSize };
} What does your |
(Quick postscript on creating these in advance: you could, at the time you populate |
Secretive - Thank you very much for your help, but unfortunately, I am getting the same result. (I pushed the changes you suggested to https://github.com/ulfie22/SectionHeaderTest ). When I run the app, You had asked about the I would be happy to invite you as a tester for the TestFlight version of this simple app. Thanks again for your help. |
Thanks for the report @ulfie22! This one was kind of a doozy because its really bizarre that it works in Debug but not in Release. In theory, it shouldn't work in Debug at all! When you are returning the node's view in @secretiverhyme's suggestion should do the trick. I created a really simple pull request to demonstrate this. As to why it works in Debug... it's got to do with some Core Animation magic. We create a reference to the node here but let Again, great issue! This was a lot of fun to look into 😃 |
Thanks @rnystrom !!!!!! I can confirm that you pull request performs as expected on the release build. I might have guessed that TableView magic would retain that header view, but even with that caching them will definitely save time on table changes and reloads. I really appreciate your help with this!! |
I have implemented a sectioned ASTableView. It renders as expected in the simulator, but when I build the app for testing in the AppStore, the section header view does not render its single ASTextNode subnode.
screen shot from simulator:
screen shot from iPhone running TestFlight build:
In the ASTableView delegate, I have implemented
The TableHeaderNode class is pretty simple:
You'll note that I call measure: on the ASTextNode in layout: - I did this because calculateSizeThatFits: is never called for this node.
So - what is different about how this is rendered in an Archive build versus running in the simulator? Any ideas how I can fix this?
Thanks for slogging through this...
The text was updated successfully, but these errors were encountered: