UITableView causing crash on iOS7? - ios

This crash is reported by a crash reporting tool, It only happens on iOS7 and I am not able to reproduce.
It seems like something calls scrollView:contentSizeForZoomScale:withProposedSize, the cell contains 2 buttons that resize depending on the data passed to it (no scrollViews, and nowhere a delegate for any UIScrollView is getting set).
Any thoughts on what causes the scrollView delegate method to get called on the cell?
Fatal Exception: NSInvalidArgumentException
-[ProfileContactUserCell scrollView:contentSizeForZoomScale:withProposedSize:]: unrecognized selector sent to instance 0x127592a20
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x000000018169b100 __exceptionPreprocess
1 libobjc.A.dylib 0x000000018dba41fc objc_exception_throw
2 CoreFoundation 0x000000018169fdb4 __methodDescriptionForSelector
3 CoreFoundation 0x000000018169dae0 ___forwarding___
4 CoreFoundation 0x00000001815bd78c _CF_forwarding_prep_0
5 UIKit 0x0000000184680d38 -[UIScrollView setFrame:]
6 UIKit 0x000000018467b12c -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:]
7 UIKit 0x000000018476ad20 -[UIScrollView _resizeWithOldSuperviewSize:]
8 CoreFoundation 0x00000001815ad1dc __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke
9 CoreFoundation 0x00000001815ad0a8 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
10 UIKit 0x000000018466a9f8 -[UIView(Geometry) resizeSubviewsWithOldSize:]
11 UIKit 0x000000018465b9f8 -[UIView(Geometry) setFrame:]
12 UIKit 0x00000001847400d8 -[UITableViewCell setFrame:]
13 UIKit 0x00000001847adf74 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke
14 UIKit 0x0000000184672de0 +[UIView(Animation) performWithoutAnimation:]
15 UIKit 0x00000001847adcc8 -[UITableView _configureCellForDisplay:forIndexPath:]
16 UIKit 0x00000001847ac90c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:]
17 UIKit 0x000000018474ae4c -[UITableView _updateVisibleCellsNow:]
18 UIKit 0x000000018473d8a4 -[UITableView _visibleCells]
19 UIKit 0x000000018473d768 -[UITableView setSeparatorStyle:]
20 Company 0x00000001000ae7ac -[ProfileViewController viewDidLoad] (ProfileViewController.m:104)
21 UIKit 0x0000000184664658 -[UIViewController loadViewIfRequired]
22 UIKit 0x00000001846643dc -[UIViewController view]
23 UIKit 0x0000000184811850 -[UINavigationController _startCustomTransition:]
24 UIKit 0x000000018471bf3c -[UINavigationController _startDeferredTransitionIfNeeded:]
25 UIKit 0x000000018471bd0c -[UINavigationController __viewWillLayoutSubviews]
26 UIKit 0x000000018471bc8c -[UILayoutContainerView layoutSubviews]
27 UIKit 0x000000018465efe0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
28 QuartzCore 0x0000000184250258 -[CALayer layoutSublayers]
29 QuartzCore 0x000000018424ae20 CA::Layer::layout_if_needed(CA::Transaction*)
30 QuartzCore 0x000000018424acd8 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
31 QuartzCore 0x000000018424a560 CA::Context::commit_transaction(CA::Transaction*)
32 QuartzCore 0x000000018424a304 CA::Transaction::commit()
33 UIKit 0x0000000184663154 _UIApplicationHandleEventQueue
34 CoreFoundation 0x000000018165b7f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
35 CoreFoundation 0x000000018165ab50 __CFRunLoopDoSources0
36 CoreFoundation 0x0000000181658de8 __CFRunLoopRun
37 CoreFoundation 0x0000000181599dd0 CFRunLoopRunSpecific
38 GraphicsServices 0x0000000187281c0c GSEventRunModal
39 UIKit 0x00000001846cafc4 UIApplicationMain
40 Company 0x0000000100072c1c main (main.m:13)
41 libdyld.dylib 0x000000018e197aa0 start
EDIT:
Implemented that method, and it looks like it's being called by:
<UITableViewCellScrollView: 0x78e39ee0; frame = (0 0; 320 44); autoresize = W+H; gestureRecognizers = <NSArray: 0x78eafc10>; layer = <CALayer: 0x78e354a0>; contentOffset: {0, 0}>

On iOS7 apple made changes to the view hierarchy of a UITableViewCell.
In iOS 7 the contntView is embedded in a UIScrollView, and the scrollView on some situations (I haven't figured out when) calls that method on the cell.
The fix was to implement the following method and return the poposedSize. This fix is only needed on iOS7. The viewHierarchy on iOS8+ has been changed to the way it was on iOS6. (No more UIScrollView is used in a tableViewCell hierarchy)
- (CGSize)scrollView:(id)arg1 contentSizeForZoomScale:(float)arg2 withProposedSize:(CGSize)arg3 {
return arg3;
}

Related

App crashes with "Could not instantiate class named _UIScrollViewLayoutGuide" on iOS 10 and older

I have been getting the below error and none of the existing Stack Overflow answers helped. I am poor at finding the exact location where error is formed by looking console results.
This is the error I get when I run in older devices (works fine in newer devices). What things can I try to determine the problem?
2019-12-30 16:52:04.784 Hospital[7075:164758] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UIScrollViewLayoutGuide'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ad9fb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a804141 objc_exception_throw + 48
2 CoreFoundation 0x000000010ae08625 +[NSException raise:format:] + 197
3 UIKit 0x000000010c15368d UINibDecoderDecodeObjectForValue + 323
4 UIKit 0x000000010c15353f -[UINibDecoder decodeObjectForKey:] + 89
5 Foundation 0x0000000109b0e417 -[NSLayoutConstraint initWithCoder:] + 757
6 UIKit 0x000000010c1537ff UINibDecoderDecodeObjectForValue + 693
7 UIKit 0x000000010c15399d UINibDecoderDecodeObjectForValue + 1107
8 UIKit 0x000000010c15353f -[UINibDecoder decodeObjectForKey:] + 89
9 UIKit 0x000000010bbee9de -[UIView initWithCoder:] + 2209
10 UIKit 0x000000010bc29687 -[UIScrollView initWithCoder:] + 71
11 UIKit 0x000000010c1537ff UINibDecoderDecodeObjectForValue + 693
12 UIKit 0x000000010c15399d UINibDecoderDecodeObjectForValue + 1107
13 UIKit 0x000000010c15353f -[UINibDecoder decodeObjectForKey:] + 89
14 UIKit 0x000000010bbee4ed -[UIView initWithCoder:] + 944
15 UIKit 0x000000010c1537ff UINibDecoderDecodeObjectForValue + 693
16 UIKit 0x000000010c15353f -[UINibDecoder decodeObjectForKey:] + 89
17 UIKit 0x000000010bf62f70 -[UIRuntimeConnection initWithCoder:] + 178
18 UIKit 0x000000010c1537ff UINibDecoderDecodeObjectForValue + 693
19 UIKit 0x000000010c15399d UINibDecoderDecodeObjectForValue + 1107
20 UIKit 0x000000010c15353f -[UINibDecoder a:] + 89
21 UIKit 0x000000010bf6216d -[UINib instantiateWithOwner:options:] + 1262
22 UIKit 0x000000010bcfcfc3 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
23 UIKit 0x000000010bcfd8d9 -[UIViewController loadView] + 177
24 UIKit 0x000000010bcfdc0a -[UIViewController loadViewIfRequired] + 195
25 UIKit 0x000000010bcfe45a -[UIViewController view] + 27
26 Hospital 0x00000001086ecb00 $s15_Hospital15PagerScrollViewC03setcdE010toParentVC05pagesI0ySo16UIViewControllerC_SayAHGSgtF + 1152
27 Hospital 0x00000001086f6b85 $s15_Hospital22HomeMainViewControllerC11viewDidLoadyyF + 3861
28 Hospital 0x00000001086f6e9b $s15_Hospital22HomeMainViewControllerC11viewDidLoadyyFTo + 43
29 UIKit 0x000000010bcfe01a -[UIViewController loadViewIfRequired] + 1235
30 UIKit 0x000000010bd3ce6c -[UINavigationController _layoutViewController:] + 56
31 UIKit 0x000000010bd3d74a -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 466
32 UIKit 0x000000010bd3d8bb -[UINavigationController _startTransition:fromViewController:toViewController:] + 127
33 UIKit 0x000000010bd3ea03 -[UINavigationController _startDeferredTransitionIfNeeded:] + 843
34 UIKit 0x000000010bd3fb41 -[UINavigationController __viewWillLayoutSubviews] + 58
35 UIKit 0x000000010bf3160c -[UILayoutContainerView layoutSubviews] + 231
36 UIKit 0x000000010bc1e55b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268
37 QuartzCore 0x000000010a572904 -[CALayer layoutSublayers] + 146
38 QuartzCore 0x000000010a566526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370
39 QuartzCore 0x000000010a5663a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
40 QuartzCore 0x000000010a4f5e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
41 QuartzCore 0x000000010a522130 _ZN2CA11Transaction6commitEv + 468
42 QuartzCore 0x000000010a522b37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115
43 CoreFoundation 0x000000010ad45717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
44 CoreFoundation 0x000000010ad45687 __CFRunLoopDoObservers + 391
45 CoreFoundation 0x000000010ad2a038 CFRunLoopRunSpecific + 440
46 UIKit 0x000000010bb5508f -[UIApplication _run] + 468
47 UIKit 0x000000010bb5b134 UIApplicationMain + 159
48 Hospital 0x000000010872773b main + 75
49 libdyld.dylib 0x000000010e5d965d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I had the same issue (using Xcode11 and running iOS 10.3.1).
Unchecking Content Layout Guides from the Scroll View worked for me.
image
Thanks to #Luke's answer I've found the exact reason of the problem: it is caused by constraints between any item and scroll view's Content Layout Guide.
So to find where the problem one needs to:
check the log to find out which view controller participates in the problem. According to the log shown by #Jaseel.Dev it is "Alexis_Hospital"
In that view controller in Interface Builder check all scroll views and their Content Layout Guides or Frame Layout Guides
There 2 ways to fix:
a) click on the scroll view, there Uncheck [ ] Content Layout Guides and check them again (Interface Builder will reassign the "layout guide" edges to "superview")
b) click on the Content Autolayout Guide and check if there any constraints pointing to them. Get rid of those constraints.
The main idea is to remove these constrains, which would crash on iOS 10 and earlier.
Please check following things in your source code:
Check if your Xib or Storyboard file has warnings with IBOutlet or
IBAction connection.
It looks like the error should be in your Xib or Storyboard since the error log backtraces shows error at UINibDecoder.
UILayoutGuide is available from iOS 9.0+, so check your app's deployment target which should be iOS 9 or above.
Also you have mentioned that you are seeing this issue only in older devices which may run with less than iOS 9.
Uncheck "Use Safe Area Layout Guides" option in the File Inspector in Xcode.
Finally check your previous working version of source code and compare the recent changes with error codebase to determine the reason for crash.

App with both Swift 3 and Objective-C crashes only on iPhone SE

I'm developing an app using both Swift 3 and Objective-C.
I keep getting the following crash only on iPhone SE:
Fatal Exception: NSInvalidArgumentException
-[_TtGCs26_SwiftDeferredNSDictionarySSP__ length]: unrecognized selector sent to instance 0x17022b880
This is the stack trace:
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x18d6aefe0 __exceptionPreprocess
1 libobjc.A.dylib 0x18c110538 objc_exception_throw
2 CoreFoundation 0x18d6b5ef4 __methodDescriptionForSelector
3 CoreFoundation 0x18d6b2f54 ___forwarding___
4 CoreFoundation 0x18d5aed4c _CF_forwarding_prep_0
5 UIKit 0x193cdac38 -[UIButton _updateTitleView]
6 UIKit 0x193856be4 -[UIButton tintColorDidChange]
7 UIKit 0x193cf4e40 -[_UITintColorVisitor _visitView:]
8 UIKit 0x193cf5524 _UIViewVisitorEntertainVisitors
9 UIKit 0x193cf4658 _UIViewVisitorRecursivelyEntertainDescendingVisitors
10 UIKit 0x193cf4708 _UIViewVisitorRecursivelyEntertainDescendingVisitors
11 UIKit 0x193cf3fa4 _UIViewVisitorEntertainDescendingTrackingVisitors
12 UIKit 0x1937db964 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke
13 Foundation 0x18e0e8a7c -[NSISEngine withBehaviors:performModifications:]
14 UIKit 0x1937db76c -[UIView(Hierarchy) _postMovedFromSuperview:]
15 UIKit 0x1937e7668 -[UIView(Internal) _addSubview:positioned:relativeTo:]
16 UIKit 0x1937e6f84 -[UIView(Hierarchy) addSubview:]
17 UIKit 0x193ac4c84 -[UIView _setTraitStorageSubviews:]
18 Foundation 0x18e0c364c -[NSObject(NSKeyValueCoding) setValue:forKey:]
19 UIKit 0x193addfe0 -[UIView(CALayerDelegate) setValue:forKey:]
20 UIKit 0x193c63fb8 -[_UIRelationshipTraitStorage applyRecordsMatchingTraitCollection:]
21 UIKit 0x193c62968 -[NSObject(_UITraitStorageAccessors) _applyTraitStorageRecordsForTraitCollection:]
22 UIKit 0x193ac87cc -[UIView _traitCollectionDidChangeFromOldCollection:toNewCollection:scaleDidChange:]
23 UIKit 0x193ac88f0 -[UIView _wrappedProcessDidChangeRecursivelyFromOldTraits:toCurrentTraits:scaleDidChange:forceNotification:]
24 UIKit 0x194140340 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:]
25 UIKit 0x193ac8b54 -[UIView _processDidChangeRecursivelyFromOldTraits:toCurrentTraits:forceNotification:]
26 UIKit 0x1937dd00c -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
27 QuartzCore 0x1909cd274 -[CALayer layoutSublayers]
28 QuartzCore 0x1909c1de8 CA::Layer::layout_if_needed(CA::Transaction*)
29 QuartzCore 0x1909c1ca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
30 QuartzCore 0x19093d34c CA::Context::commit_transaction(CA::Transaction*)
31 QuartzCore 0x1909643ac CA::Transaction::commit()
32 QuartzCore 0x190964e78 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
33 CoreFoundation 0x18d65c9a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
34 CoreFoundation 0x18d65a630 __CFRunLoopDoObservers
35 CoreFoundation 0x18d65aa7c __CFRunLoopRun
36 CoreFoundation 0x18d58ada4 CFRunLoopRunSpecific
37 GraphicsServices 0x18eff4074 GSEventRunModal
38 UIKit 0x193845058 UIApplicationMain
39 <MyApp> 0x10004fc5c main (main.m:14)
40 libdyld.dylib 0x18c59959c start
Does anybody know what could be the cause of this kind of crashes?
Thanks.

Unrecognized Selector Instance When Performing Segue

When performing programatically performing a segue, the segue does work and the intended storyboard opens, but terminates immediately afterwards. The view controller/storyboard does work and shouldn't have any errors in the code as I've tested it individually, so I'm not entirely sure as to why it terminates. Any help would be appreciated.
2017-05-01 20:22:59.358605 FInal Project[15659:499662] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/student/Library/Developer/CoreSimulator/Devices/265EA47F-07A6-47C7-A6B4-5E62D37E72BA/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-05-01 20:22:59.376075 FInal Project[15659:499662] [MC] Reading from private effective user settings.
in
2017-05-01 20:23:48.095 FInal Project[15659:499662] <UILayoutContainerView: 0x7fdae3c082f0; frame = (0 0; 414 736); autoresize = W+H; gestureRecognizers = <NSArray: 0x600000242be0>; layer = <CALayer: 0x60000003ea40>>'s window is not equal to <UINavigationController: 0x7fdae40aee00>'s view's window!
2017-05-01 20:23:48.715 FInal Project[15659:499662] -[FInal_Project.User_Info NameInputEditingDidEnd:]: unrecognized selector sent to instance 0x7fdae3c11d40
2017-05-01 20:23:48.721 FInal Project[15659:499662] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FInal_Project.User_Info NameInputEditingDidEnd:]: unrecognized selector sent to instance 0x7fdae3c11d40'
*** First throw call stack:
(
0 CoreFoundation 0x0000000101fc3d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000101a2521e objc_exception_throw + 48
2 CoreFoundation 0x0000000102033f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000101f49005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000101f48b88 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001030cb8bc -[UIApplication sendAction:to:from:forEvent:] + 83
6 UIKit 0x0000000103251c38 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x0000000103251f51 -[UIControl _sendActionsForEvents:withEvent:] + 444
8 UIKit 0x0000000103bdbc20 -[UITextField _resignFirstResponder] + 313
9 UIKit 0x00000001032e1778 -[UIResponder _finishResignFirstResponder] + 286
10 UIKit 0x0000000103bdba0e -[UITextField _finishResignFirstResponder] + 49
11 UIKit 0x00000001032e1827 -[UIResponder resignFirstResponder] + 140
12 UIKit 0x0000000103bdb8dd -[UITextField resignFirstResponder] + 136
13 UIKit 0x000000010317802f -[UIView(Hierarchy) _removeFirstResponderFromSubtree] + 167
14 UIKit 0x00000001031786b8 __UIViewWillBeRemovedFromSuperview + 76
15 UIKit 0x000000010317846a -[UIView(Hierarchy) removeFromSuperview] + 95
16 UIKit 0x000000010324d451 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke.629 + 704
17 UIKit 0x0000000103246fba -[UIPresentationController transitionDidFinish:] + 111
18 UIKit 0x000000010345ef83 -[_UICurrentContextPresentationController transitionDidFinish:] + 42
19 UIKit 0x000000010324aef0 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 183
20 UIKit 0x0000000103c0c56c -[_UIViewControllerTransitionContext completeTransition:] + 102
21 UIKit 0x0000000103243ddc -[UITransitionView notifyDidCompleteTransition:] + 251
22 UIKit 0x0000000103243aef -[UITransitionView _didCompleteTransition:] + 1539
23 UIKit 0x000000010324651c -[UITransitionView _transitionDidStop:finished:] + 104
24 UIKit 0x0000000103156bd5 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 222
25 UIKit 0x000000010315712a -[UIViewAnimationState animationDidStop:finished:] + 136
26 QuartzCore 0x0000000108526648 _ZN2CA5Layer23run_animation_callbacksEPv + 316
27 libdispatch.dylib 0x0000000105e2e0cd _dispatch_client_callout + 8
28 libdispatch.dylib 0x0000000105e0e8a4 _dispatch_main_queue_callback_4CF + 406
29 CoreFoundation 0x0000000101f87e49 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
30 CoreFoundation 0x0000000101f4d37d __CFRunLoopRun + 2205
31 CoreFoundation 0x0000000101f4c884 CFRunLoopRunSpecific + 420
32 GraphicsServices 0x0000000107d38a6f GSEventRunModal + 161
33 UIKit 0x00000001030c9c68 UIApplicationMain + 159
34 FInal Project 0x00000001013fb65f main + 111
35 libdyld.dylib 0x0000000105e7a68d start + 1
36 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
The issue (discovered in the comments above) was that there was an action in the storyboard that was no longer hooked up to an action in code.
If anyone else in the future has a similar problem, look through the outlets menu for an outlet or action with the name provided in the console output. In this case, the action was named NameInputEditingDidEnd.
To expand on Nathan's answer, instead of randomly looking around, just cmd+shift+f the name of the outlet, in this case NameInputEditingDidEnd, and xcode will output the storyboard with the dangling outlet for you and center you to it.

MKMapView unexpected crash issue

In viewDidLoad I have only 2 strings:
MKMapView *mapViewMy = [[MKMapView alloc]init];
[self.view addSubview:mapViewMy];
And the app crashed on "[self.view addSubview:mapViewMy]". I use iOS7. It crashes both on devices and simulators. When I use simulator I have crash report:
2013-11-06 13:34:15.948 MyBex JAPanel[36286:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x0216c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01eef8b6 objc_exception_throw + 44
2 CoreFoundation 0x0211ebcc -[__NSArrayM insertObject:atIndex:] + 844
3 CoreFoundation 0x0211e870 -[__NSArrayM addObject:] + 64
4 UIKit 0x01190b67 PushNextClassForSettingIMP + 358
5 UIKit 0x0118905e TaggingAppearanceObjectSetterIMP + 43
6 UIKit 0x00d6d8de -[UIViewController _setUpLayoutGuideConstraintIfNecessaryAtTop:] + 424
7 UIKit 0x00d6c1c3 -[UIViewController topLayoutGuide] + 140
8 MapKit 0x023d16a8 -[MKMapView updateLayoutGuides] + 82
9 MapKit 0x023d17e7 -[MKMapView didMoveToSuperview] + 68
10 UIKit 0x00cba636 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 472
11 UIKit 0x00cba388 -[UIView(Hierarchy) _postMovedFromSuperview:] + 260
12 UIKit 0x00cc54c1 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1847
13 UIKit 0x00cb89b1 -[UIView(Hierarchy) addSubview:] + 56
14 UIKit 0x01189077 TaggingAppearanceObjectSetterIMP + 68
15 MyBex JAPanel 0x0001180e -[MapViewController configureView] + 142
16 MyBex JAPanel 0x00011778 -[MapViewController viewDidLoad] + 88
17 UIKit 0x00d71318 -[UIViewController loadViewIfRequired] + 696
18 UIKit 0x00d96b15 -[UINavigationController _layoutViewController:] + 39
19 UIKit 0x00d9702b -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
20 UIKit 0x00d97123 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
21 UIKit 0x00d9809c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
22 UIKit 0x00d98cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
23 UIKit 0x00ed2181 -[UILayoutContainerView layoutSubviews] + 213
24 UIKit 0x00cc8267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
25 libobjc.A.dylib 0x01f0181f -[NSObject performSelector:withObject:] + 70
26 QuartzCore 0x005c82ea -[CALayer layoutSublayers] + 148
27 QuartzCore 0x005bc0d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
28 QuartzCore 0x005bbf40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
29 QuartzCore 0x00523ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
30 QuartzCore 0x00524e71 _ZN2CA11Transaction6commitEv + 393
31 QuartzCore 0x005e1430 +[CATransaction flush] + 52
32 UIKit 0x00c79dc9 _afterCACommitHandler + 131
33 CoreFoundation 0x021344ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
34 CoreFoundation 0x0213441f __CFRunLoopDoObservers + 399
35 CoreFoundation 0x02112344 __CFRunLoopRun + 1076
36 CoreFoundation 0x02111ac3 CFRunLoopRunSpecific + 467
37 CoreFoundation 0x021118db CFRunLoopRunInMode + 123
38 GraphicsServices 0x027f29e2 GSEventRunModal + 192
39 GraphicsServices 0x027f2809 GSEventRun + 104
40 UIKit 0x00c5dd3b UIApplicationMain + 1225
41 MyBex JAPanel 0x0003bc0d main + 141
42 libdyld.dylib 0x03423725 start + 0
43 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I checked, both mapViewMy and self.view are not nil.
Its seems like in our viewDidLoad your object is miss referencing
Make sure you have added Framework of MapKit
Import Map Kit & Delegate in your .h file
Try this code :
MKMapView *mapViewMy = [[MKMapView alloc] initWithFrame:self.view.bounds];
mapViewMy.delegate=self;
[self.view addSubview:mapViewMy];
You need to add map kit delegates methods. :)
in .h file
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
//import MKMapkit framwork
#interface mapSampleViewController : UIViewController {
<MKMapViewDelegate>//mapview delegate
{
MKMapView *mapView;
}
in .m file
add this code in viewdidload
mapView= [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
mapView.delegate = self;
[self.view addSubview:mapView];

Application crash after updated to IOS7

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.

Resources