Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[TIMOB-8365] Ensure section is always retrieved on main thread #2256

Merged
merged 1 commit into from

2 participants

@vishalduggal
Collaborator

Test is in JIRA
FR should include a regression against TIMOB-6368

@mstepanov

Core reviewed. APPROVED

@mstepanov

FT PASSED
Tested on iPhoneSim 4.3 / iPhone 4S 5.1.1

@mstepanov mstepanov merged commit ecb3c70 into appcelerator:master
@vishalduggal vishalduggal deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 4 deletions.
  1. +7 −4 iphone/Classes/TiUITableViewProxy.m
View
11 iphone/Classes/TiUITableViewProxy.m
@@ -631,12 +631,15 @@ -(void)appendRow:(id)args
{
id header = [row valueForKey:@"header"];
TiUITableViewActionType actionType = TiUITableViewActionAppendRow;
- TiUITableViewSectionProxy* section = [sections lastObject];
+ __block TiUITableViewSectionProxy* section = nil;
+ TiThreadPerformOnMainThread(^{
+ section = [sections lastObject];
+ }, YES);
+
if (header != nil) {
+ NSInteger newSectionIndex = section.section + 1;
section = [self sectionWithHeader:header table:table];
- TiThreadPerformOnMainThread(^{
- section.section = [sections count];
- }, YES);
+ section.section = newSectionIndex;
actionType = TiUITableViewActionAppendRowWithSection;
}
row.section = section;
Something went wrong with that request. Please try again.