iOS 12 SDK require autolayout? - ios

I started a new project in Xcode 10 using iOS SDK 12. I selected the Master-Detail App template. I can run the app from the start without making any changes to the project and it works. But when the only change I make is I turn off auto layout in the Main.storyboard and the app crashes when selecting an item in the Master view and sends it to the Detail view. even though the only change I made was turning Autolayout off.
Does iOS 12 SDK require autolayout?
In Xcode 9, turning off Autolayout in a Master-Detail app template would not cause this crash.
Any help would be greatly appreciated, I know I should be transitioning to autolayout instead of doing everything manually but I have gotten there yet.
Below is the error that spits out.
2018-10-08 11:16:02.968981-0400 Trial2[1100:19064] -[DetailViewController topViewController]: unrecognized selector sent to instance 0x7fbb3652b350
2018-10-08 11:16:02.981283-0400 Trial2[1100:19064] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DetailViewController topViewController]: unrecognized selector sent to instance 0x7fbb3652b350'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f2ce29b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010df3f735 objc_exception_throw + 48
2 CoreFoundation 0x000000010f2ecfa4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 UIKitCore 0x0000000111cac163 -[UIResponder doesNotRecognizeSelector:] + 287
4 CoreFoundation 0x000000010f2d2fb6 ___forwarding___ + 1446
5 CoreFoundation 0x000000010f2d4e88 _CF_forwarding_prep_0 + 120
6 Trial2 0x000000010d61d049 -[MasterViewController prepareForSegue:sender:] + 361
7 UIKitCore 0x0000000111dc05c7 -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 182
8 UIKitCore 0x0000000111dc04e3 -[UIStoryboardSegueTemplate _perform:] + 82
9 UIKitCore 0x0000000111dc07a5 -[UIStoryboardSegueTemplate perform:] + 157
10 UIKitCore 0x0000000111e19cbb -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1703
11 UIKitCore 0x0000000111e19f44 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344
12 UIKitCore 0x00000001118d097e _runAfterCACommitDeferredBlocks + 318
13 UIKitCore 0x00000001118bf424 _cleanUpAfterCAFlushAndRunDeferredBlocks + 384
14 UIKitCore 0x00000001118ee870 _afterCACommitHandler + 135
15 CoreFoundation 0x000000010f231037 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
16 CoreFoundation 0x000000010f22b4ce __CFRunLoopDoObservers + 430
17 CoreFoundation 0x000000010f22bb61 __CFRunLoopRun + 1537
18 CoreFoundation 0x000000010f22b221 CFRunLoopRunSpecific + 625
19 GraphicsServices 0x00000001175f91dd GSEventRunModal + 62
20 UIKitCore 0x00000001118c5115 UIApplicationMain + 140
21 Trial2 0x000000010d61bef0 main + 112
22 libdyld.dylib 0x000000011099b551 start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Update after Stephen Darlington's Answer
The first picture is how the Initial Storyboard when the project was created.
The second picture is How the storyboard was changed when Autolayout was turned off.

This has nothing to do with autolayout. "Manual" layout is still full supported; autolayout is only Apple's preferred method.
Instead the error is on the first line of your stack trace:
-[DetailViewController topViewController]: unrecognized selector sent to instance 0x7fbb3652b350
Looks like a UINavigationController has been removed somewhere and topViewController is being sent to a view controller instead.

Related

terminating with uncaught exception of type NSException Message from debugger: Terminated due to signal 6

My app keeps crashing on iOS but android part is working smoothly
Help!
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView bridge]: unrecognized selector sent to instance 0x7f957cf1f340'
*** First throw call stack:
(
0 CoreFoundation 0x000000011227d8ab __exceptionPreprocess + 242
1 libobjc.A.dylib 0x000000010bdb6ba3 objc_exception_throw + 48
2 CoreFoundation 0x000000011228cab8 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 UIKitCore 0x000000013a17ee0a -[UIResponder doesNotRecognizeSelector:] + 264
4 CoreFoundation 0x0000000112281d71 ___forwarding___ + 1431
5 CoreFoundation 0x0000000112284068 _CF_forwarding_prep_0 + 120
6 TestApp 0x000000010169c204 +[ReactNativeBlobUtil getRCTEventDispatcher] + 244
7 TestApp 0x000000010169c6c4 __27-[ReactNativeBlobUtil init]_block_invoke + 36
8 libdispatch.dylib 0x000000011679cd18 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000011679df5b _dispatch_client_callout + 8
10 libdispatch.dylib 0x00000001167aed55 _dispatch_main_queue_drain + 1463
11 libdispatch.dylib 0x00000001167ae790 _dispatch_main_queue_callback_4CF + 31
12 CoreFoundation 0x00000001121dcb1f __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x00000001121d7436 __CFRunLoopRun + 2482
14 CoreFoundation 0x00000001121d66a7 CFRunLoopRunSpecific + 560
15 GraphicsServices 0x000000011fd1128a GSEventRunModal + 139
16 UIKitCore 0x000000013a144ad3 -[UIApplication _run] + 994
17 UIKitCore 0x000000013a1499ef UIApplicationMain + 123
18 TestApp 0x0000000100f8d678 main + 104
19 dyld 0x000000010ba342bf start_sim + 10
20 ??? 0x0000000203536310 0x0 + 8645731088
)
libc++abi: terminating with uncaught exception of type NSException
Message from debugger: Terminated due to signal 6
I tried deleting derived data and doing pod update and podinstall aswell as Clean build folder
The problem might be caused because the library you use might support only the latest iOS versions or it might be an outdated library. So try to figure out the issue by running you application in various iOS versions. The application will run in certain iOS versions based on the issue. If the app crashes again, try to run after uninstalling that library from your project.
Now the application will run. Try other libraries if that library isn't supporting the iOS version you use.
I got the same issue with PayPalCheckout Library which supports iOS versions higher that iOS 15. When I ran it on iOS 12 device I got the same issue, but when I tried to run it on iOS 15.7 it worked just fine.

iOS 9 push segue is causing my app to crash

In iOS 8.4, simulator and phone, I experience no issue with my performSegue call, but when using the simulator on Xcode 7 beta 5, when the performSegue call is made, it crashes. The call stack is below.
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 3 beyond bounds [0 .. 1]'
*** First throw call stack:
(
0 CoreFoundation 0x00000001137509b5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001131c8deb objc_exception_throw + 48
2 CoreFoundation 0x00000001136179d5 -[__NSArrayM insertObject:atIndex:] + 901
3 Foundation 0x0000000110c42aa1 -[NSKeyValueSlowMutableArray insertObject:atIndex:] + 106
4 CoreFoundation 0x000000011366beb2 -[NSMutableArray insertObjects:count:atIndex:] + 162
5 CoreFoundation 0x000000011366bc1f -[NSMutableArray insertObjectsFromArray:range:atIndex:] + 335
6 CoreFoundation 0x000000011366baa3 -[NSMutableArray addObjectsFromArray:] + 723
7 UIKit 0x00000001119ef467 -[UIRuntimeOutletCollectionConnection performConnect] + 860
8 CoreFoundation 0x0000000113691590 -[NSArray makeObjectsPerformSelector:] + 224
9 UIKit 0x000000011173ccaa -[UINib instantiateWithOwner:options:] + 1864
10 UIKit 0x0000000111531df4 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
11 UIKit 0x0000000111532720 -[UIViewController loadView] + 178
12 UIKit 0x0000000111532a22 -[UIViewController loadViewIfRequired] + 138
13 UIKit 0x0000000111538e33 -[UIViewController __viewWillAppear:] + 120
14 UIKit 0x0000000111565cba -[UINavigationController _startCustomTransition:] + 1177
15 UIKit 0x00000001115752f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
16 UIKit 0x00000001115761ad -[UINavigationController __viewWillLayoutSubviews] + 57
17 UIKit 0x00000001117082d1 -[UILayoutContainerView layoutSubviews] + 248
18 UIKit 0x0000000111459a3b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
19 QuartzCore 0x00000001110f336a -[CALayer layoutSublayers] + 146
20 QuartzCore 0x00000001110e7bd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
21 QuartzCore 0x00000001110e7a4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
22 QuartzCore 0x00000001110dc1d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
23 QuartzCore 0x00000001111099f0 _ZN2CA11Transaction6commitEv + 508
24 UIKit 0x00000001113d5eb0 _afterCACommitHandler + 174
25 CoreFoundation 0x000000011367c457 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
26 CoreFoundation 0x000000011367c3c7 __CFRunLoopDoObservers + 391
27 CoreFoundation 0x000000011367201b __CFRunLoopRun + 1147
28 CoreFoundation 0x0000000113671918 CFRunLoopRunSpecific + 488
29 GraphicsServices 0x0000000115ee3ad2 GSEventRunModal + 161
30 UIKit 0x00000001113ac99e UIApplicationMain + 171
31 MyApp 0x000000010fbfe59f main + 111
32 libdyld.dylib 0x000000011429c92d start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
It doesn't look like it has anything to do with my code since it's happening during the transition and none of my own functions are in the call stack.
Has anybody experienced this, and/or know how to solve this? I put breakpoints in every function of my second view controller and none of them were hit.
I am sure this is bug. In my situation it was segue pointed to TabBarView.
performSegueWithIdentifier("tabSegue",sender: nil)
When it starts crashing(this happening times to times without changing sb) i just remove segue from storyboard and create it back. And it works.
Some people report that pointing a segue to ViewController instead of NavigationController fix the issue. You may try that option if it fits.
Source: https://forums.developer.apple.com/message/11153#11153
This issue is related to an invalid setup with Referencing Outlet Collections in a .xib file. for my particular project it was related to adding the same UIGestureRecognizer to the gestureRecognizer collection of multiple views. This worked prior to ios 9 but now crashes the program with an identical stack trace. If you know the view controller that causes the crash (and it sounds like you do because you're able to reproduce the crash), you should be able to see an error in the console telling you what is going on. If not I would examine each Referencing Outlet Collection in the .xib file and try to find the one that is causing the error.
It looks like a bug in the program instead of system. Please take a look at connection inspector to see if there is any unexpected outlet connection or broken outlet connection.
Fix for me: I was using custom segue for push. When i replaced custom segue with show segue issue fixed.
Looks like it was just an issue with Xcode. I still had the problem after installing the final release. I uninstalled Xcode and reinstalled from the App Store and didn't have the problem anymore. Thanks for all the suggested answers though! I've definitely had the issue of a bad segue in Storyboard before, but this time, it was just Xcode.

New kivy-Ios toolchain, application crashes when portrait orientation is disabled

I tried to create package for iOS 8.2 using new kivy-ios toolchain on OS X 10.9.5. Unfortunately when I disable 'Portrait' orientation in 'Deployment Info' xcode 6.2, application crashes with following output:
2015-03-11 04:48:32.449 testapp[1478:44792] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [SDLLaunchScreenController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f245a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010edcebb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010f2459ad +[NSException raise:format:] + 205
3 UIKit 0x000000010ce4a263 -[UIViewController __supportedInterfaceOrientations] + 644
4 UIKit 0x000000010ce3f9e3 -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 64
5 UIKit 0x000000010cd55b43 -[UIWindow setRootViewController:] + 103
6 testapp 0x000000010b940a25 -[SDLUIKitDelegate application:didFinishLaunchingWithOptions:] + 413
7 UIKit 0x000000010cd0b458 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
8 UIKit 0x000000010cd0c002 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2540
9 UIKit 0x000000010cd0ee3e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
10 UIKit 0x000000010cd0dd35 -[UIApplication workspaceDidEndTransaction:] + 179
11 FrontBoardServices 0x0000000112a62243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
12 CoreFoundation 0x000000010f17ac7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
13 CoreFoundation 0x000000010f1709c5 __CFRunLoopDoBlocks + 341
14 CoreFoundation 0x000000010f170785 __CFRunLoopRun + 2389
15 CoreFoundation 0x000000010f16fbc6 CFRunLoopRunSpecific + 470
16 UIKit 0x000000010cd0d7a2 -[UIApplication _run] + 413
17 UIKit 0x000000010cd10580 UIApplicationMain + 1282
18 testapp 0x000000010b93fa9b main + 203
19 libdyld.dylib 0x000000011037f145 start + 1
20 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I have done test on iPhone 5s and iOS symulator, both gave me same results.
It worked fine before, on old kivy-ios toolchain, iOS 8.1 and xcode 6.1. The new iOS and xcode is quite new now so I can't find any answer. Only thing I found is this question Kivy-ios sdl2 run on ios in low resolution about low resolution which is another problem that I have too after upgrade.

unrecognized selector isPitched called

In my app, I am displaying a map with annotations, and the user can browse the list of annotations in a table view (in a modal view controller).
I am experiencing a weird bug that I can reproduce both on device and in the simulator (iOS 7 & 8).
When in pitched mode, if I try to select an item in my POI table view, it does one of these :
changes the map center to a random point on the map, not the selected annotation.
crashes with the message that I put under (NSZombies enabled).
-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7f24e6e0
I tried several methods to solve this bug, but with no success. And what puzzles me is I can't find any information on the isPitched method. It isn't in my code, neither in Apple documentation.
Does someone knows more on MapKit and these types of problem ?
Alternatively, would you know a way to deactivate the pitch when a user select a POI in the list ? Maybe it would prevent the bug.
EDIT : Just found that the 'isPitched' method is actually part of VectorKit ! Doesn't really help, though. No documentation on VectorKit...
EDIT 2 : Added stack trace.
-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7db84870
2015-02-28 14:25:08.501 Cartel 2015[2481:178443] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7db84870'
*** First throw call stack:
(
0 CoreFoundation 0x00afb946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x00784a97 objc_exception_throw + 44
2 CoreFoundation 0x00b035c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x00a4c3e7 ___forwarding___ + 1047
4 CoreFoundation 0x00a4bfae _CF_forwarding_prep_0 + 14
5 VectorKit 0x02dd09c1 __86-[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:]_block_invoke + 1809
6 VectorKit 0x02d88645 -[VKAnimation onTimerFired:] + 357
7 VectorKit 0x02d9895e -[VKScreenCanvas animateWithTimestamp:] + 686
8 VectorKit 0x02d9850e -[VKScreenCanvas updateWithTimestamp:] + 46
9 VectorKit 0x02d71e69 -[VKMapView onTimerFired:] + 89
10 libobjc.A.dylib 0x0079a771 -[NSObject performSelector:withObject:] + 70
11 VectorKit 0x0323463c -[GGLDisplayLink _displayLinkFired:] + 60
12 QuartzCore 0x041abcad _ZN2CA7Display15DisplayLinkItem8dispatchEv + 45
13 QuartzCore 0x041abb83 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 311
14 QuartzCore 0x041ac067 _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
15 CoreFoundation 0x00a558d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
16 CoreFoundation 0x00a5525d __CFRunLoopDoTimer + 1309
17 CoreFoundation 0x00a146ba __CFRunLoopRun + 2090
18 CoreFoundation 0x00a13bcb CFRunLoopRunSpecific + 443
19 CoreFoundation 0x00a139fb CFRunLoopRunInMode + 123
20 GraphicsServices 0x03f4324f GSEventRunModal + 192
21 GraphicsServices 0x03f4308c GSEventRun + 104
22 UIKit 0x00f318b6 UIApplicationMain + 1526
23 Cartel 2015 0x0001110d main + 141
24 libdyld.dylib 0x046aaac9 start + 1
25 ??? 0x00000001 0x0 + 1
OK, I managed to prevent the crash with the following fix.
When a POI is selected in my list, I trigger a delegate method of the view controller that handles the MapView from the didSelect method of the controller of the tableView. If you have the same problem, I assume you understand what I mean, so far.
In this method, I asked the MapView to center itself on the coordinates of the POI.
Now, to solve the problem that only happened when the user tracking mode was set to "pitched" (following your orientation), I simply added a line to deactivate this tracking mode at the beginning of my method :
[mapView setUserTrackingMode: MKUserTrackingModeNone] ;
This removed the crashes that randomly appeared. Notice that it doesn't result in a counterintuitive behavior because this tracking mode is automatically deactivated when the user moves the map.
So problem solved for me but if you have any information about this isPitched selector and what really caused the problem, you're very welcome to post it here !

EKEventstore crash when accessed from different controllers

I'm new here but I've been reading along a lot. Mostely I found what I was looking for but now I'm stuck. Reading documentation and asking google didn't help so here I go:
I have an app that adds events to the user's calendar using EKEventstore. I used to do this all from one single view controller, including the function to pick one of the user's calendars. I've been creating eventstores several times in the code, and everything worked fine.
Now I've upgraded my app to some more professional coding, including several view controllers. One is handling the calendar picker (simple table view listing all calendars), another one does the creation and saving of new events to the calendar.
The EKEvenstore is declared in the appdelegate.h
EKEventStore *es;
Each view controller defines the evenststore in it's viewWillAppear method:
es=[[EKEventStore alloc]init];
Everything works fine, I can load and safe events from and to the eventstore, but as soon as I switch to the calendar picker view controller (just loading it up), and then going back to the view controller that creates events, the app crashes. After a new launch I everything is fine again. Any Idea is highly appreciated.
Here's my stack after the exception throw:
2011-08-25 15:35:18.795 Dutysheet Wx[13864:707] -[UINavigationButton refresh]: unrecognized selector sent to instance 0x688f0a0
2011-08-25 15:35:18.822 Dutysheet Wx[13864:707] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationButton refresh]: unrecognized selector sent to instance 0x688f0a0'
* Call stack at first throw:
(
0 CoreFoundation 0x30b1364f exceptionPreprocess + 114
1 libobjc.A.dylib 0x3462ec5d objc_exception_throw + 24
2 CoreFoundation 0x30b171bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x30b16649 __forwarding + 508
4 CoreFoundation 0x30a8d180 _CF_forwarding_prep_0 + 48
5 EventKit 0x339bfe1b -[EKEventStore _databaseChangedExternally] + 682
6 EventKit 0x339bf49f DatabaseChanged + 18
7 CoreFoundation 0x30ae2d69 CFNotificationCenterDarwinCallBack + 24
8 CoreFoundation 0x30adfbdf __CFMachPortPerform + 210
9 CoreFoundation 0x30aeaa97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 26
10 CoreFoundation 0x30aec83f __CFRunLoopDoSource1 + 166
11 CoreFoundation 0x30aed60d __CFRunLoopRun + 520
12 CoreFoundation 0x30a7dec3 CFRunLoopRunSpecific + 230
13 CoreFoundation 0x30a7ddcb CFRunLoopRunInMode + 58
14 GraphicsServices 0x303fc41f GSEventRunModal + 114
15 GraphicsServices 0x303fc4cb GSEventRun + 62
16 UIKit 0x30ba3d69 -[UIApplication _run] + 404
17 UIKit 0x30ba1807 UIApplicationMain + 670
18 Dutysheet Wx 0x00002a83 main + 82
19 Dutysheet Wx 0x000029f8 start + 52
)
terminate called after throwing an instance of 'NSException'

Resources