-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ios): TableView "sectionCount" property crash #12193
Conversation
Fixes TIMOB-13903
|
{ //TODO: Shouldn't this be in the main thread, too? | ||
return [sections count]; | ||
return NUMUINTEGER((sections != nil) ? sections.count : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the only required change, and the rest of the lines/changes are not necessary. Why not just leave this method as returning NSUInteger
as before and avoid the need to explicitly call [NSNumber unsignedIntegerValue]
to get one in the above changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't crashing because sections
was nil
.
(That's just a safety mechanism I added just in case.)
It was crashing because the calling code here expected the property's return type to be an NSObject
derived type, but it received an NSUInteger
which is a typedef'ed unsigned int. That's why I changed it to NSNumber
, which is the same return type our TiUIListViewProxy
uses for sectionCount
here.
FR: Pass Test Environment |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-13903
Unit Test Note:
RecylerView PR #12029 is making heavy changes to the
ti.ui.tableview.test.js
script. In order to avoid a huge amount of conflicts, we should re-enable alliosBroken
unit tests via that PR instead of this one.(I've already verified this PR's change fixes the unit tests.)
Test: