I am using UITableViewController , in header view of table added search bar. Search and cancel button work fine for me in iOS 6 but in iOS 7 search working fine and when i tapped on cancel button app crash with below message .
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.'
*** First throw call stack:
(
0 CoreFoundation 0x021f05e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01f738b6 objc_exception_throw + 44
2 CoreFoundation 0x021f0448 +[NSException raise:format:arguments:] + 136
3 Foundation 0x01b53fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4 UIKit 0x00b1f33b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 567
5 libobjc.A.dylib 0x01f8581f -[NSObject performSelector:withObject:] + 70
6 QuartzCore 0x01a392ea -[CALayer layoutSublayers] + 148
7 QuartzCore 0x01a2d0d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
8 QuartzCore 0x01a3b715 -[CALayer(CALayerPrivate) layoutBelowIfNeeded] + 43
9 UIKit 0x00b11c76 -[UIView(Hierarchy) layoutBelowIfNeeded] + 595
10 UIKit 0x00e4be70 -[UISearchDisplayController _hoistSearchBar] + 992
11 UIKit 0x00e4ccb2 -[UISearchDisplayController showHideAnimationDidFinish] + 108
12 UIKit 0x00b00c6c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
13 UIKit 0x00b00f58 -[UIViewAnimationState animationDidStop:finished:] + 80
14 QuartzCore 0x01a34a44 _ZN2CA5Layer23run_animation_callbacksEPv + 304
15 libdispatch.dylib 0x0249f4b0 _dispatch_client_callout + 14
16 libdispatch.dylib 0x0248d75e _dispatch_main_queue_callback_4CF + 340
17 CoreFoundation 0x02255a5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
18 CoreFoundation 0x021966bb __CFRunLoopRun + 1963
19 CoreFoundation 0x02195ac3 CFRunLoopRunSpecific + 467
20 CoreFoundation 0x021958db CFRunLoopRunInMode + 123
21 GraphicsServices 0x033df9e2 GSEventRunModal + 192
22 GraphicsServices 0x033df809 GSEventRun + 104
23 UIKit 0x00ab4d3b UIApplicationMain + 1225
24 uAlign 0x00001f6d main + 141
25 libdyld.dylib 0x0273170d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am using storyboard and default cancel button .
Please help on this . Thank you .
Uncheck Use AutoLaout field and try to run it again, see below image:
UITableView's implementation of -layoutSubviews needs to call super.
I think this is the problem.
Check all of your UITableView's layoutSubviews implementation, add [super layoutSubviews];.
- (void)layoutSubviews{
[super layoutSubviews];
//to do other things
}
Related
The UITableView works fine when I am trying to use it through Xcode6.4, but when I'm trying it through Xcode 7.1.1 it crashes. I guess it's because of the iOS versions. I am attaching the crash log. Kindly suggest what the best way to fix it is. I am quite sure that:
1) Datasource and Delegates are working fine.
2) Numberofrows and heightOfRow methods are also getting called, but it crashes before the cellForRowAtIndexPath gets called.
Here is the log:
2016-02-05 15:34:27.400 Autograph24[3720:87023] * Assertion failure
in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableViewRowData.m:2310
2016-02-05 15:34:27.506 Autograph24[3720:87023] * Terminating app
due to uncaught exception 'NSInternalInconsistencyException', reason:
'Invalid indexPath'
*** First throw call stack: ( 0 CoreFoundation 0x00000001075c9f45 exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000107956deb objc_exception_throw + 48 2 CoreFoundation
0x00000001075c9daa +[NSException raise:format:arguments:] + 106 3
Foundation 0x0000000106e9b5ee
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 4
UIKit 0x0000000108d11412
-[UITableViewRowData _assertValidIndexPath:allowEmptySection:] + 963 5 UIKit 0x0000000108d11465
-[UITableViewRowData ensureHeightsFaultedInForIndexPath:availHeight:edgeInset:scrollPosition:]
+ 55 6 UIKit 0x0000000108af50c6 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2510 7 UIKit 0x0000000108af59b9
-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 39 8 Autograph24 0x0000000106b1b2ad
-[DashboardVC scrollToToday] + 685 9 Autograph24 0x0000000106b20289 -[DashboardVC changeCalendarStyle] + 313 10
Autograph24 0x0000000106b20144 -[DashboardVC
resizeScreenForPortrait] + 788 11 Autograph24
0x0000000106b1f6a0 -[DashboardVC rotateScreen] + 176 12 Autograph24
0x0000000106b15e76 -[DashboardVC viewDidLoad] + 166 13 UIKit
0x0000000108b49cc4 -[UIViewController loadViewIfRequired] + 1198 14
UIKit 0x0000000108b4fc7b
-[UIViewController __viewWillAppear:] + 120 15 UIKit 0x0000000108b7fa37 -[UINavigationController _startCustomTransition:] +
1203 16 UIKit 0x0000000108b8fcdb
-[UINavigationController _startDeferredTransitionIfNeeded:] + 712 17 UIKit 0x0000000108b90cea
-[UINavigationController __viewWillLayoutSubviews] + 57 18 UIKit 0x0000000108d36c85 -[UILayoutContainerView layoutSubviews] + 248 19
UIKit 0x0000000108a6be40
-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710 20 QuartzCore 0x000000010736359a -[CALayer
layoutSublayers] + 146 21 QuartzCore
0x0000000107357e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE +
366 22 QuartzCore 0x0000000107357cee
_ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 23 QuartzCore 0x000000010734c475
_ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 24 QuartzCore 0x0000000107379c0a
_ZN2CA11Transaction6commitEv + 486 25 QuartzCore 0x000000010737a37c
_ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 26 CoreFoundation 0x00000001074f5947
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 27 CoreFoundation 0x00000001074f58b7
__CFRunLoopDoObservers + 391 28 CoreFoundation 0x00000001074eb50b __CFRunLoopRun + 1147 29 CoreFoundation
0x00000001074eae08 CFRunLoopRunSpecific + 488 30 GraphicsServices
0x000000010b1b5ad2 GSEventRunModal + 161 31 UIKit
0x00000001089b730d UIApplicationMain + 171 32 Autograph24
0x0000000106b15d9f main + 111 33 libdyld.dylib
0x000000010aac192d start + 1 34 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException
You have an invalid indexpath. That means that either the section or the row or both is not right. If you have a table with 2 sections and 2 rows per section then indexpath 0-3 is invalid, because section 0 does not provide a row 3. Similarly, indexpath 2-1 would be invalid, because section 2 does not exist (only 0 and 1).
As for how to fix this, first double check if all required methods are called and your data is correctly initialised. Then sprinkle breakpoints around your class. Mainly where you use any kind of indexpath, and see where it tries to read from outside your data.
Learn to read crash logs. In most cases and certainly in this case, they contain all the relevant information:
2016-02-05 15:34:27.400 Autograph24[3720:87023] * Assertion failure in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableViewRowData.m:2310
2016-02-05 15:34:27.506 Autograph24[3720:87023] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid indexPath'
It clearly says: reason: 'Invalid indexPath'
So first hint: an invalid index path (which is a well known thing if you work with UITableViews) was involved.
Next follows the stack trace where the error ocurred. The first few stack locations are within Apple's code. Usually skip them. But occasionally, they contain interesting hints. Here a function assertValidIndexPath:allowEmptySection:. That again shows that the index path is the problem.
*** First throw call stack: (
0 CoreFoundation 0x00000001075c9f45 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107956deb objc_exception_throw + 48
2 CoreFoundation 0x00000001075c9daa +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000106e9b5ee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x0000000108d11412 -[UITableViewRowData _assertValidIndexPath:allowEmptySection:] + 963
5 UIKit 0x0000000108d11465 -[UITableViewRowData ensureHeightsFaultedInForIndexPath:availHeight:edgeInset:scrollPosition:] + 55
6 UIKit 0x0000000108af50c6 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2510
7 UIKit 0x0000000108af59b9 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 39
Here your code follows. Look at the line above and below. It says that your function [DashboardVC scrollToToday] has called the function [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]. This is where the error was triggered in your code.
8 Autograph24 0x0000000106b1b2ad -[DashboardVC scrollToToday] + 685
9 Autograph24 0x0000000106b20289 -[DashboardVC changeCalendarStyle] + 313
10 Autograph24 0x0000000106b20144 -[DashboardVC resizeScreenForPortrait] + 788
11 Autograph24 0x0000000106b1f6a0 -[DashboardVC rotateScreen] + 176
12 Autograph24 0x0000000106b15e76 -[DashboardVC viewDidLoad] + 166
This is the next interesting location. Here Apple's UIKit called your [DashboardVC viewDidLoad]. So that gives a lot of context. It happend early during the construction of you view in the viewDidLoad phase.
13 UIKit 0x0000000108b49cc4 -[UIViewController loadViewIfRequired] + 1198
14 UIKit 0x0000000108b4fc7b -[UIViewController __viewWillAppear:] + 120
15 UIKit 0x0000000108b7fa37 -[UINavigationController _startCustomTransition:] + 1203
16 UIKit 0x0000000108b8fcdb -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
17 UIKit 0x0000000108b90cea -[UINavigationController __viewWillLayoutSubviews] + 57
18 UIKit 0x0000000108d36c85 -[UILayoutContainerView layoutSubviews] + 248
19 UIKit 0x0000000108a6be40 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
20 QuartzCore 0x000000010736359a -[CALayer layoutSublayers] + 146
21 QuartzCore 0x0000000107357e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
22 QuartzCore 0x0000000107357cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
23 QuartzCore 0x000000010734c475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
24 QuartzCore 0x0000000107379c0a _ZN2CA11Transaction6commitEv + 486
25 QuartzCore 0x000000010737a37c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
26 CoreFoundation 0x00000001074f5947 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
27 CoreFoundation 0x00000001074f58b7 __CFRunLoopDoObservers + 391
28 CoreFoundation 0x00000001074eb50b __CFRunLoopRun + 1147
29 CoreFoundation 0x00000001074eae08 CFRunLoopRunSpecific + 488
30 GraphicsServices 0x000000010b1b5ad2 GSEventRunModal + 161
31 UIKit 0x00000001089b730d UIApplicationMain + 171
32 Autograph24 0x0000000106b15d9f main + 111
33 libdyld.dylib 0x000000010aac192d start + 1
34 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib:
terminating with uncaught exception of type NSException
Combining this information I would conclude that you call [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] from within [DashboardVC viewDidLoad], which is bound to fail with any index path because the UITableView is not properly constructed at this time of the view controller's lifecycle.
Earlier iOS versions were more lenient here; but later versions are rather restrictive about what you can do before the view controller is fully constructed.
You will need to move your [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] call to either viewWillAppear: or even viewDidAppear:.
The application I work on is displaying a CollectionView in form of a calendar.
To simplify that we used the MSCollectionViewCalendarLayout from github.
Now it comes with multiple additional decoration views like a red line, which represents the current time in the calendar.
In our implementation there is also the possibility of filtering for different types, so the calendar not always displays the same kind/amount of cells. Unfortunately sometimes the application crashes just out of nowhere, when it should display the red timeline:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for layout attributes for decoration view of kind MSCollectionElementKindCurrentTimeHorizontalGridline in section 0 when there are only 0 sections in the collection view'
*** First throw call stack:
(
0 CoreFoundation 0x034761e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02fcb8e5 objc_exception_throw + 44
2 CoreFoundation 0x03476048 +[NSException raise:format:arguments:] + 136
3 Foundation 0x00e2f4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4 UIKit 0x018eb290 -[UICollectionViewData layoutAttributesForDecorationViewOfKind:atIndexPath:] + 228
5 UIKit 0x018b5764 -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 242
6 UIKit 0x018a8036 -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:] + 381
7 UIKit 0x018a9775 -[UICollectionView _updateVisibleCellsNow:] + 4730
8 UIKit 0x018ad65f -[UICollectionView layoutSubviews] + 265
9 UIKit 0x012d0964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
10 libobjc.A.dylib 0x02fdd82b -[NSObject performSelector:withObject:] + 70
11 QuartzCore 0x026a445a -[CALayer layoutSublayers] + 148
12 QuartzCore 0x02698244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
13 QuartzCore 0x026980b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
14 QuartzCore 0x025fe7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
15 QuartzCore 0x025ffb85 _ZN2CA11Transaction6commitEv + 393
16 QuartzCore 0x02600258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
17 CoreFoundation 0x0343e36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
18 CoreFoundation 0x0343e2bf __CFRunLoopDoObservers + 399
19 CoreFoundation 0x0341c254 __CFRunLoopRun + 1076
20 CoreFoundation 0x0341b9d3 CFRunLoopRunSpecific + 467
21 CoreFoundation 0x0341b7eb CFRunLoopRunInMode + 123
22 GraphicsServices 0x049615ee GSEventRunModal + 192
23 GraphicsServices 0x0496142b GSEventRun + 104
24 UIKit 0x01261f9b UIApplicationMain + 1225
25 CariAudit 0x001036ad main + 141
26 libdyld.dylib 0x039d9701 start + 1
27 ??? 0x00000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Now I know that with this custom layout, many people get this error message when they change the underlying data of the collectionView and the solution to this is to call "invalidateLayoutCache" on the layout. The only problem is that I already have that in my code and it gets called before calling reloadData on the collectionView.
Does anyone maybe have an idea/approach for solving this kind of problem?
Thanks
After hours of searching I finally managed to find the error.
The problem was that the MSCollectionViewCalendarLayout missed to empty the Attributes-Dictionaries
currentTimeIndicatorAttributes and currentTimeHorizontalGridlineAttributes.
To fix the error all I had to do was to expand the invalidateLayoutCache method with the following:
[self.currentTimeIndicatorAttributes removeAllObjects];
[self.currentTimeHorizontalGridlineAttributes removeAllObjects];
What i have Done?
In one of my UIViewController child i have implemented UITableView and have implemented the necessary UITableViewDelegate functions.
What i am Facing?
The issue i am facing is that i get EXC_BAD_ACCESS in Application whenever i relaunch the Controller and tap on Any cell.
What i have Tried?
I have tried to place breakpoints in the function didDeselectRowAtIndexPath: but it never reaches the Breakpoint. I tried Global Exception Breakpoint but it also didn't worked. I checked using the Instruments and found that a zombie is detechted when didDeselectRowAtIndexPath is called but control doesn't reaches the Function.
Instruments Zombie Details Image - Photo Bucket Link
After Implementing the Given Suggestions in the Comments this is the log that i have received
*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x023e11e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01fc98e5 objc_exception_throw + 44
2 CoreFoundation 0x02393abc -[__NSArrayM insertObject:atIndex:] + 844
3 CoreFoundation 0x02393760 -[__NSArrayM addObject:] + 64
4 UIKit 0x00bf5782 -[UITableViewIndex _displayTitles] + 1071
5 UIKit 0x00bf58a8 -[UITableViewIndex _cacheAndMeasureTitles] + 171
6 UIKit 0x00bf6213 -[UITableViewIndex sizeThatFits:] + 131
7 UIKit 0x00a18bbc -[UITableView _updateIndexFrameSuppressingChangeNotification:] + 513
8 UIKit 0x00a189b6 -[UITableView _updateIndexFrame] + 41
9 UIKit 0x00a19a5f -[UITableView _updateIndex] + 649
10 UIKit 0x00a336f7 -[UITableView layoutSubviews] + 295
11 UIKit 0x009b3964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
12 libobjc.A.dylib 0x01fdb82b -[NSObject performSelector:withObject:] + 70
13 QuartzCore 0x002ba45a -[CALayer layoutSublayers] + 148
14 QuartzCore 0x002ae244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
15 QuartzCore 0x002ae0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
16 QuartzCore 0x002147fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
17 QuartzCore 0x00215b85 _ZN2CA11Transaction6commitEv + 393
18 QuartzCore 0x00216258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
19 CoreFoundation 0x023a936e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
20 CoreFoundation 0x023a92bf __CFRunLoopDoObservers + 399
21 CoreFoundation 0x02387254 __CFRunLoopRun + 1076
22 CoreFoundation 0x023869d3 CFRunLoopRunSpecific + 467
23 CoreFoundation 0x023867eb CFRunLoopRunInMode + 123
24 GraphicsServices 0x0381a5ee GSEventRunModal + 192
25 GraphicsServices 0x0381a42b GSEventRun + 104
26 UIKit 0x00944f9b UIApplicationMain + 1225
27 MyApplication 0x00001f9c main + 76
28 libdyld.dylib 0x034b3701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
It is pretty clear from all the logs and Zombie images that you are accessing the deallocated CountryListViewController. Keep track on the CountryListViewController and check it is available while you processing your table-view operations.
The better option is, Go to Xcode Menu Product->Scheme->Mange Schemes->Edit (left bottom)-> Debug-> Diagnostics -> Check all the options -> then Run the project.
This will be the Lighthouse to discover your crash.
I'm facing a problem with UIViewController containment via MFSideMenu.
Problem is, on ViewControllers that support orientation, opening the side menu and selecting a different menu option (when the device is in landscape mode) causes the app to crash. This behavior worked perfectly in iOS 6, but is now failing in iOS 7.
Here's the stack trace:
2014-03-05 14:40:00.335 MyApp[21890:70b]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'custom navigation transition - no popping between different orientations!'
*** First throw call stack:
(
0 CoreFoundation 0x024515e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x021098b6 objc_exception_throw + 44
2 CoreFoundation 0x024513bb +[NSException raise:format:] + 139
3 UIKit 0x009434b4 -[UINavigationController _startCustomTransition:] + 988
4 UIKit 0x009500c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
5 UIKit 0x00950cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
6 UIKit 0x00a8a181 -[UILayoutContainerView layoutSubviews] + 213
7 UIKit 0x00880267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
8 libobjc.A.dylib 0x0211b81f -[NSObject performSelector:withObject:] + 70
9 QuartzCore 0x01ecd2ea -[CALayer layoutSublayers] + 148
10 QuartzCore 0x01ec10d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
11 QuartzCore 0x01ec0f40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
12 QuartzCore 0x01e28ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
13 QuartzCore 0x01e29e71 _ZN2CA11Transaction6commitEv + 393
14 QuartzCore 0x01e2a544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
15 CoreFoundation 0x024194ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
16 CoreFoundation 0x0241941f __CFRunLoopDoObservers + 399
17 CoreFoundation 0x023f7344 __CFRunLoopRun + 1076
18 CoreFoundation 0x023f6ac3 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x023f68db CFRunLoopRunInMode + 123
20 GraphicsServices 0x036979e2 GSEventRunModal + 192
21 GraphicsServices 0x03697809 GSEventRun + 104
22 UIKit 0x00815d3b UIApplicationMain + 1225
23 MyApp 0x000022aa main + 138
24 libdyld.dylib 0x02e9f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any help in debugging this is appreciate.
P/S: Note the spelling mistake for "orientation" in the console log. I'm leaving it misspelt in case others stumble upon this problem as well.
Please check whether you are having the below functions.If then, please disable those and try,
(BOOL) shouldAutoRotate;
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
remove all orientation related methods.
Thanks,
ithay.
I have updated my app to IOS7 and now I have very strange issue.
When I start app it start to do what it suppose to do and after 3-5 minutes app stops to work. But not completely. It stops to send notifications, track location etc.
And if I try to make some action I get this in console:
*** First throw call stack:
(
0 CoreFoundation 0x0305f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0276e8b6 objc_exception_throw + 44
2 CoreFoundation 0x0305f3bb +[NSException raise:format:] + 139
3 UIKit 0x0157465c -[UINib instantiateWithOwner:options:] + 951
4 UIKit 0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
5 UIKit 0x013e743d -[UIViewController loadView] + 302
6 UIKit 0x013e773e -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
8 UIKit 0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
9 UIKit 0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
10 UIKit 0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
11 UIKit 0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
12 UIKit 0x0154839d -[UILayoutContainerView layoutSubviews] + 213
13 UIKit 0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
14 UIKit 0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x0278081f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x00ef972a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x00e564e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x00f12870 +[CATransaction flush] + 52
22 UIKit 0x012f0979 _afterCACommitHandler + 131
23 CoreFoundation 0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x0302748f __CFRunLoopDoObservers + 399
25 CoreFoundation 0x030053b4 __CFRunLoopRun + 1076
26 CoreFoundation 0x03004b33 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x0300494b CFRunLoopRunInMode + 123
28 GraphicsServices 0x03ce89d7 GSEventRunModal + 192
29 GraphicsServices 0x03ce87fe GSEventRun + 104
30 UIKit 0x012d494b UIApplicationMain + 1225
31 MyApp 0x0000759d main + 141
32 libdyld.dylib 0x02c53725 start + 0
33 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any idea what is this?
App works fine in IOS6.
Create an exception breakpoint in Xcode that stops on all exceptions. Then the debugger will stop when that exception is raised. It looks like it is in
[UINib instantiateWithOwner:options:]
But I can't tell if you are calling that or the system.
See here for a related issue:
Terminating app due to uncaught exception 'NSUnknownKeyException'
I must test this on real phone just to be sure.
I have a piece of code that refreshes some labels in the view every X seconds.
It works fine until IOS7. On IOS7 app crashes after 3 minutes and I get the error from the question.
Every time I refresh labels in the view I was opened a new connection to sqlite to get data.
In IOS7 I get error so I made one instance of data access class and init it only in viewDidLoad() and now it works fine.
If after test I confirm that I am right I will definitely make singleton pattern of my data access class.