Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17088] iOS7: ListView with footers crashes when deleting an item on iOS 7

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-11-10T04:48:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterViktor Korol
AssigneeEric Merriman
Created2014-05-24T09:19:21.000+0000
Updated2017-03-21T20:52:08.000+0000

Description

Steps to Reproduce

1) Run next code on iOS 7 (SDK 3.2.3 GA):
var wnd = Ti.UI.createWindow({
	backgroundColor: "red"
});

var listView = Ti.UI.createListView({
});
var sections = [];

for (i = 0; i < 3; ++i) {
	var items = [];
	
	if (i < 2) {
		for (j = 0; j < 3; ++j) {
			items.push({
				properties : {
					height: "100dp",
					title: "section: " + (i + 1) + " item: " + (j + 1),
					canEdit: true
				}
			});
		}
	}
	
	var section = Ti.UI.createListSection({
		headerTitle: "Header " + (i + 1),
		footerTitle: "Footer " + (i + 1),
		items: items
	});
	

	sections.push(section);
}

listView.sections = sections;

wnd.add(listView);
wnd.open();
2) Scroll to bottom. 2) Try to delete item 'Section: 2 Item: 3' - swipe left and press delete button

Actual Result

Application crashes
2014-05-23 22:16:35.225 ListViewDeleteItem[8125:60b] *** Assertion failure in -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:], /SourceCache/UIKit_Sim/UIKit-2935.137/UITableViewSupport.m:2666
[ERROR] The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.
Reason:
Cell animation stop fraction must be greater than start fraction
Stack trace:

0   CoreFoundation                      0x045a91c8 __exceptionPreprocess + 152
1   libobjc.A.dylib                     0x03f8f8e5 objc_exception_throw + 44
2   CoreFoundation                      0x045a9048 +[NSException raise:format:arguments:] + 136
3   Foundation                          0x010794de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4   UIKit                               0x017daef6 -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:] + 309
5   UIKit                               0x017d97da -[_UITableViewUpdateSupport(Private) _setupAnimationsForExistingHeadersAndFooters] + 8763
6   UIKit                               0x017da1f0 -[_UITableViewUpdateSupport _setupAnimations] + 261
7   UIKit                               0x01588bff -[UITableView _updateWithItems:updateSupport:] + 1898
8   UIKit                               0x01583fe7 -[UITableView _endCellAnimationsWithContext:] + 13534
9   UIKit                               0x01593cea -[UITableView endUpdatesWithContext:] + 51
10  UIKit                               0x01593d18 -[UITableView endUpdates] + 41
11  ListViewDeleteItem                  0x002bb95e -[TiUIListView tableView:commitEditingStyle:forRowAtIndexPath:] + 2622
12  UIKit                               0x015a56a3 -[UITableView animateDeletionOfRowWithCell:] + 107
13  UIKit                               0x0172e595 -[UITableViewCell _swipeDeleteButtonPushed] + 70
14  libobjc.A.dylib                     0x03fa1880 -[NSObject performSelector:withObject:withObject:] + 77
15  UIKit                               0x014ad3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
16  UIKit                               0x014ad345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
17  UIKit                               0x015aebd1 -[UIControl sendAction:to:forEvent:] + 66
18  UIKit                               0x015aefc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
19  UIKit                               0x015ae243 -[UIControl touchesEnded:withEvent:] + 641
20  UIKit                               0x014ecddd -[UIWindow _sendTouchesForEvent:] + 852
21  UIKit                               0x014ed9d1 -[UIWindow sendEvent:] + 1117
22  UIKit                               0x014bf5f2 -[UIApplication sendEvent:] + 242
23  UIKit                               0x014a9353 _UIApplicationHandleEventQueue + 11455
24  CoreFoundation                      0x0453277f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25  CoreFoundation                      0x0453210b __CFRunLoopDoSources0 + 235
26  CoreFoundation                      0x0454f1ae __CFRunLoopRun + 910
27  CoreFoundation                      0x0454e9d3 CFRunLoopRunSpecific + 467
28  CoreFoundation                      0x0454e7eb CFRunLoopRunInMode + 123
29  GraphicsServices                    0x043515ee GSEventRunModal + 192
30  GraphicsServices                    0x0435142b GSEventRun + 104
31  UIKit                               0x014abf9b UIApplicationMain + 1225
32  ListViewDeleteItem                  0x00003956 main + 134
33  ListViewDeleteItem                  0x00002ee5 start + 53

2014-05-23 22:16:35.765 ListViewDeleteItem[8125:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cell animation stop fraction must be greater than start fraction'
*** First throw call stack:
(
	0   CoreFoundation                      0x045a91e4 __exceptionPreprocess + 180
	1   libobjc.A.dylib                     0x03f8f8e5 objc_exception_throw + 44
	2   CoreFoundation                      0x045a9048 +[NSException raise:format:arguments:] + 136
	3   Foundation                          0x010794de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
	4   UIKit                               0x017daef6 -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:] + 309
	5   UIKit                               0x017d97da -[_UITableViewUpdateSupport(Private) _setupAnimationsForExistingHeadersAndFooters] + 8763
	6   UIKit                               0x017da1f0 -[_UITableViewUpdateSupport _setupAnimations] + 261
	7   UIKit                               0x01588bff -[UITableView _updateWithItems:updateSupport:] + 1898
	8   UIKit                               0x01583fe7 -[UITableView _endCellAnimationsWithContext:] + 13534
	9   UIKit                               0x01593cea -[UITableView endUpdatesWithContext:] + 51
	10  UIKit                               0x01593d18 -[UITableView endUpdates] + 41
	11  ListViewDeleteItem                  0x002bb95e -[TiUIListView tableView:commitEditingStyle:forRowAtIndexPath:] + 2622
	12  UIKit                               0x015a56a3 -[UITableView animateDeletionOfRowWithCell:] + 107
	13  UIKit                               0x0172e595 -[UITableViewCell _swipeDeleteButtonPushed] + 70
	14  libobjc.A.dylib                     0x03fa1880 -[NSObject performSelector:withObject:withObject:] + 77
	15  UIKit                               0x014ad3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
	16  UIKit                               0x014ad345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
	17  UIKit                               0x015aebd1 -[UIControl sendAction:to:forEvent:] + 66
	18  UIKit                               0x015aefc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
	19  UIKit                               0x015ae243 -[UIControl touchesEnded:withEvent:] + 641
	20  UIKit                               0x014ecddd -[UIWindow _sendTouchesForEvent:] + 852
	21  UIKit                               0x014ed9d1 -[UIWindow sendEvent:] + 1117
	22  UIKit                               0x014bf5f2 -[UIApplication sendEvent:] + 242
	23  UIKit                               0x014a9353 _UIApplicationHandleEventQueue + 11455
	24  CoreFoundation                      0x0453277f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
	25  CoreFoundation                      0x0453210b __CFRunLoopDoSources0 + 235
	26  CoreFoundation                      0x0454f1ae __CFRunLoopRun + 910
	27  CoreFoundation                      0x0454e9d3 CFRunLoopRunSpecific + 467
	28  CoreFoundation                      0x0454e7eb CFRunLoopRunInMode + 123
	29  GraphicsServices                    0x043515ee GSEventRunModal + 192
	30  GraphicsServices                    0x0435142b GSEventRun + 104
	31  UIKit                               0x014abf9b UIApplicationMain + 1225
	32  ListViewDeleteItem                  0x00003956 main + 134
	33  ListViewDeleteItem                  0x00002ee5 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Expected Result

Application should not crashes and item should be deleted.

Comments

  1. Ed 2014-09-18

    I'm seeing this issue as well. iOS 8 (device) iOS Simulator 7.1, and Ti SDK 3.3.0.
  2. Chee Kiat Ng 2014-11-07

    There's a likely chance this is an apple bug: https://devforums.apple.com/message/796520#796520 Reproduced on iOS Simulator 7.1, but is working fine on iOS Simulator 8.1 and Ti SDK 3.4.0. It looks like Apple has squashed this bug for 8.1.
  3. Chee Kiat Ng 2014-11-10

    Tested on iOS 8.0.2 device, SDK 3.4.0GA, works alright too.
  4. Lee Morris 2017-03-21

    Closing this ticket as the issue is not our bug.

JSON Source