Reputation: 261
I've been struggling with this issue for the last two weeks - not able to find a solution after scouring my code, or stack overflow.
PROBLEM:
I have a View Controller with a tableView, with cells. Most of the time, when I click on one of the cells to take push me to another View Controller, it works fine. However sometimes when I click on a cell, the app freezes. It does not crash - just freezes. I usually then have to press the home button, launch the app again - at which point the launch takes forever, causing the app to crash. I then launch the app AGAIN, and it returns fine to the first page of my app.
I have found it difficult to replicate - on normal startup and use it works fine. It seems to usually occur when I have had the app in the background for a while, or the device locked. Not completely sure how this could affect things, apart from memory cleaning up required variables.
As a note, I use the PrettyKit library, and so my cells are PrettyTableViewCells.
CRASH REPORT:
Incident Identifier: A58F4152-0593-481D-8269-1A8115739349
CrashReporter Key: 2dc2c9f2bdbc6370165a53719bc7610fcbe36ddd
Hardware Model: iPhone4,1
Process: Yoga [50409]
Path: /var/mobile/Applications/DEE2950F-4629-43D4-BA6E-349E4119094F/Yoga.app/Yoga
Identifier: Yoga
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-04-23 10:41:02.152 +1000
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0
Application Specific Information:
Yoga [50409] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x1f590b90> identifier: Suspending process: Yoga[50409] permittedBackgroundDuration: 10.000000 reason: suspend owner pid:26 preventSuspend preventThrottleDownCPU preventThrottleDownUI
)}
Elapsed total CPU time (seconds): 8.260 (user 8.260, system 0.000), 67% CPU
Elapsed application CPU time (seconds): 5.953, 49% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 CoreFoundation 0x313a21fa -[__NSSetM addObject:] + 326
1 Foundation 0x31dfd1f8 __44-[NSISEngine fixupIntegralizationViolations]_block_invoke_0 + 868
2 Foundation 0x31dfe9a4 -[NSISEngine withoutOptimizingAtEndRunBlockWithAutomaticOptimizationDisabled:] + 104
3 Foundation 0x31dfce8a -[NSISEngine fixupIntegralizationViolations] + 90
4 Foundation 0x31dfe766 -[NSISEngine optimize] + 74
5 Foundation 0x31dffc4e -[NSISEngine constraintDidChangeSuchThatMarker:shouldBeReplacedByMarkerPlusDelta:] + 82
6 Foundation 0x31dffcc8 -[NSISEngine tryToChangeConstraintSuchThatMarker:isReplacedByMarkerPlusDelta:undoHandler:] + 56
7 Foundation 0x31e0564e -[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 266
8 Foundation 0x31e059d6 -[NSLayoutConstraint _setSymbolicConstant:constant:] + 382
9 UIKit 0x3368e14a -[UIView(UIConstraintBasedLayout) _autoresizingConstraints_frameDidChange] + 342
10 UIKit 0x33253c32 -[UIView(Geometry) setFrame:] + 558
11 UIKit 0x3329ec4c -[UITableViewCellContentView setFrame:] + 48
12 Foundation 0x31d03ff2 _NSSetRectValueAndNotify + 106
13 UIKit 0x332a18cc -[UITableViewCellLayoutManager layoutSubviewsOfCell:] + 2188
14 UIKit 0x332a0968 -[UITableViewCell layoutSubviews] + 56
15 UIKit 0x332557fe -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
16 QuartzCore 0x32fffd86 -[CALayer layoutSublayers] + 210
17 QuartzCore 0x32fff924 CA::Layer::layout_if_needed(CA::Transaction*) + 456
18 QuartzCore 0x33000858 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
19 QuartzCore 0x3300023e CA::Context::commit_transaction(CA::Transaction*) + 234
20 QuartzCore 0x3300004c CA::Transaction::commit() + 312
21 QuartzCore 0x32fffeac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
22 CoreFoundation 0x3141f6ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
23 CoreFoundation 0x3141d9bc __CFRunLoopDoObservers + 272
24 CoreFoundation 0x3141dd12 __CFRunLoopRun + 738
25 CoreFoundation 0x31390eb8 CFRunLoopRunSpecific + 352
26 CoreFoundation 0x31390d44 CFRunLoopRunInMode + 100
27 GraphicsServices 0x34f692e6 GSEventRunModal + 70
28 UIKit 0x332a62fc UIApplicationMain + 1116
29 Yoga 0x000af198 0xae000 + 4504
30 libdyld.dylib 0x395a9b1c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x39660648 kevent64 + 24
1 libdispatch.dylib 0x39590974 _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x39590654 _dispatch_mgr_thread$VARIANT$mp + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x396700fc __psynch_mutexwait + 24
1 libsystem_c.dylib 0x395b9124 pthread_mutex_lock + 388
2 WebCore 0x373a6418 _WebTryThreadLock(bool) + 184
3 WebCore 0x373a634a WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 42
4 CoreFoundation 0x3141f6ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
5 CoreFoundation 0x3141d9bc __CFRunLoopDoObservers + 272
6 CoreFoundation 0x3141dde8 __CFRunLoopRun + 952
7 CoreFoundation 0x31390eb8 CFRunLoopRunSpecific + 352
8 CoreFoundation 0x31390d44 CFRunLoopRunInMode + 100
9 WebCore 0x373a4500 RunWebThread(void*) + 440
10 libsystem_c.dylib 0x395c930e _pthread_start + 306
11 libsystem_c.dylib 0x395c91d4 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x3965feb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39660048 mach_msg + 36
2 CoreFoundation 0x3141f040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x3141dd9e __CFRunLoopRun + 878
4 CoreFoundation 0x31390eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x31390d44 CFRunLoopRunInMode + 100
6 Foundation 0x31cdd3d0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x31d60e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x395c930e _pthread_start + 306
9 libsystem_c.dylib 0x395c91d4 thread_start + 4
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x39670594 __select + 20
1 CoreFoundation 0x314231f2 __CFSocketManager + 674
2 libsystem_c.dylib 0x395c930e _pthread_start + 306
3 libsystem_c.dylib 0x395c91d4 thread_start + 4
Thread 5 name: JavaScriptCore::BlockFree
Thread 5:
0 libsystem_kernel.dylib 0x3967008c __psynch_cvwait + 24
1 libsystem_c.dylib 0x395c1d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x395c1aa0 pthread_cond_timedwait + 40
3 JavaScriptCore 0x3535fc70 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 104
4 JavaScriptCore 0x35471552 JSC::BlockAllocator::blockFreeingThreadMain() + 78
5 JavaScriptCore 0x35483fa8 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x395c930e _pthread_start + 306
7 libsystem_c.dylib 0x395c91d4 thread_start + 4
Thread 6 name: JavaScriptCore::Marking
Thread 6:
0 libsystem_kernel.dylib 0x3967008c __psynch_cvwait + 24
1 libsystem_c.dylib 0x395c1d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x395cbf14 pthread_cond_wait + 36
3 JavaScriptCore 0x35404f3c JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 144
4 JavaScriptCore 0x35404e7c JSC::MarkStackThreadSharedData::markingThreadMain() + 140
5 JavaScriptCore 0x35483fa8 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x395c930e _pthread_start + 306
7 libsystem_c.dylib 0x395c91d4 thread_start + 4
Thread 7 name: WebCore: CFNetwork Loader
Thread 7:
0 libsystem_kernel.dylib 0x3965feb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39660048 mach_msg + 36
2 CoreFoundation 0x3141f040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x3141dd9e __CFRunLoopRun + 878
4 CoreFoundation 0x31390eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x31390d44 CFRunLoopRunInMode + 100
6 WebCore 0x3743ed02 WebCore::runLoaderThread(void*) + 138
7 JavaScriptCore 0x35483fa8 WTF::wtfThreadEntryPoint(void*) + 12
8 libsystem_c.dylib 0x395c930e _pthread_start + 306
9 libsystem_c.dylib 0x395c91d4 thread_start + 4
Unknown thread crashed with unknown flavor: 5, state_count: 1
CODE:
I have identified through logging that the code successfully passes through my didSelectRowAtIndexPath and prepareForSegue methods before freezing. Hence I believe it has something to do with the table cell construction? Or some memory problem I'm not addressing?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"logPracticeDetails" sender:indexPath];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSIndexPath *indexPath = sender;
if ([segue.identifier isEqualToString:@"logPracticeDetails"])
{
YLLogPracticeViewController *controller = segue.destinationViewController;
controller.logPractice = [self.logEntry.logEntryPractices objectAtIndex:indexPath.row];
}
}
Any help much appreciated.
Upvotes: 4
Views: 603
Reputation: 4918
For anyone who would still have a similar issue, I found out that the cause was AutoLayout in my project.
All I had to do was just to deactivate AutoLayout for my UIViewController
and the freezes stopped.
Upvotes: 1
Reputation: 213
[self performSegueWithIdentifier:@"logPracticeDetails" sender:indexPath];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
put it like
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
[self performSegueWithIdentifier:@"logPracticeDetails" sender:indexPath];
first you deselect and then go to next page
Upvotes: 0