У меня было приложение прохладно в iOS6
, но когда я обновил для iOS7
с тем же кодом, с которым я работал, я получаю эту ошибку, когда пытаюсь удалить строку в таблица:Crash иногда удаляет строку в UITableView (только в iOS7)
UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:
следующий код, как этот
- (void)tableView:(UITableView *)sender commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source.
[self.tableView beginUpdates];
PACallLog *aLog = _logs[indexPath.row];
[[PAFMDBManager sharedManager] deleteACallLog:aLog];
[_logs removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView endUpdates];
}
}
В методе viewDidAppear
, журналы (массив) получить значения из БД, поэтому, когда я удалить строку, я должен 1.delete данные от db 2.delte объект из бревен 3.execute deleteRowsAtIndexPaths
метод
Но иногда я получаю аварии, когда я удалить строку (только в IOS7
) может кто-нибудь мне помочь?
Краш журнала:
Last Exception Backtrace:
0 CoreFoundation 0x3065ae7e __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3a9b76c2 objc_exception_throw + 34
2 CoreFoundation 0x3065ad50 +[NSException raise:format:arguments:] + 100
3 Foundation 0x310030aa -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 86
4 UIKit 0x32fdc8ce -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:] + 350
5 UIKit 0x32fe020e -[_UITableViewUpdateSupport(Private) _setupAnimationsForExistingHeadersAndFooters] + 5278
6 UIKit 0x32fda7d6 -[_UITableViewUpdateSupport _setupAnimations] + 182
7 UIKit 0x32fda286 -[UITableView _updateWithItems:updateSupport:] + 1358
8 UIKit 0x32fb2392 -[UITableView _endCellAnimationsWithContext:] + 8014
9 2cu 0x00137a14 0x4000 + 1260052
10 UIKit 0x32fd87c2 -[UITableView animateDeletionOfRowWithCell:] + 90
11 UIKit 0x32fd8754 -[UITableViewCell _swipeDeleteButtonPushed] + 60
12 UIKit 0x32e13d9e -[UIApplication sendAction:to:from:forEvent:] + 86
13 UIKit 0x32e13d3a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 34
14 UIKit 0x32e13d0e -[UIControl sendAction:to:forEvent:] + 42
15 UIKit 0x32dff73e -[UIControl _sendActionsForEvents:withEvent:] + 370
16 UIKit 0x32e13756 -[UIControl touchesEnded:withEvent:] + 590
17 UIKit 0x32e13420 -[UIWindow _sendTouchesForEvent:] + 524
18 UIKit 0x32e0e44c -[UIWindow sendEvent:] + 828
19 UIKit 0x32de3d74 -[UIApplication sendEvent:] + 192
20 UIKit 0x32de2564 _UIApplicationHandleEventQueue + 7112
Можете ли вы вставить точный отчет об ошибке? – jailani
пожалуйста, поместите журнал сбоев в пост, чтобы мы могли рассказать вам о проблеме и решении проблемы. –
Конечно, я обновлю журнал ошибок – passol