iOS 11 UIWebView drop down menus completely broken on iPad - UIPopoverController - ipad

When using HTML select element, UIWebView presents a native UIPopoverController as dropdown list on iPad (iPhone uses UIPickerView which works fine).
On iOS11 this appears to be completely broken:
Clicking outside dropdown to dismiss without selecting an option results in popover being closed and immediately re-presented, occasionally empty
When more than one drop down on the page, drop down for new list contains elements from previous list
When selecting second drop down, first one re-opens
Occassionally drop down appears in top left corner (presumably lost it's source view)
Above steps very occasionally result in the following crash:
2017-09-23 09:43:13.190728+0100 Web[1779:86622] * Terminating app
due to uncaught exception 'NSInternalInconsistencyException', reason:
'UITableView dataSource is not set'
* First throw call stack: ( 0 CoreFoundation 0x000000010d4a01cb exceptionPreprocess + 171 1 libobjc.A.dylib
0x000000010c8bbf41 objc_exception_throw + 48 2 CoreFoundation
0x000000010d4a5362 +[NSException raise:format:arguments:] + 98 3
Foundation 0x000000010c360089
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193 4
UIKit 0x000000010da742f5 -[UITableView
_createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1756 5 UIKit 0x000000010da7451a -[UITableView
_createPreparedCellForRowAtIndexPath:willDisplay:] + 81 6 UIKit 0x000000010da82137 -[UITableView _heightForRowAtIndexPath:] + 208 7
UIKit 0x000000010dd2b939
-[UISectionRowData heightForRow:inSection:canGuess:] + 259 8 UIKit 0x000000010dd31c1a -[UITableViewRowData
heightForRow:inSection:canGuess:adjustForReorderedRow:] + 277 9
UIKit 0x000000010dd36230
-[UITableViewRowData ensureHeightsFaultedInForScrollToIndexPath:withScrollPosition:boundsHeight:]
+ 964 10 UIKit 0x000000010da51110 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:]
+ 2783 11 UIKit 0x000000010da51b8f -[UITableView _scrollToRowAtIndexPath:atScrollPosition:animated:usingPresentationValues:]
+ 146 12 UIKit 0x000000010da51a11 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 123 13 UIKit 0x000000010de72d11
-[UIWebSelectTableViewController viewWillAppear:] + 247 14 UIKit 0x000000010dabe9b0 -[UIViewController
_setViewAppearState:isAnimating:] + 444 15 UIKit 0x000000010dabf245 -[UIViewController __viewWillAppear:] + 147 16
UIKit 0x000000010da8b881
__56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 1088 17 UIKit
0x000000010d926c61 _runAfterCACommitDeferredBlocks + 318 18 UIKit
0x000000010d91530d _cleanUpAfterCAFlushAndRunDeferredBlocks + 280 19
UIKit 0x000000010d945600
_afterCACommitHandler + 137 20 CoreFoundation 0x000000010d442db7
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 21 CoreFoundation 0x000000010d442d0e
__CFRunLoopDoObservers + 430 22 CoreFoundation 0x000000010d427324 __CFRunLoopRun + 1572 23 CoreFoundation
0x000000010d426a89 CFRunLoopRunSpecific + 409 24 GraphicsServices
0x00000001124c89c6 GSEventRunModal + 62 25 UIKit
0x000000010d91ad30 UIApplicationMain + 159 26 Web
0x000000010bfb014f main + 111 27 libdyld.dylib
0x0000000110df1d81 start + 1 28 ???
0x0000000000000001 0x0 + 1`
I created a sample application with one line of code which demonstrates the issue:
https://github.com/AshRobinson/BrokenUIWebView
http://gph.is/2xmHFWs
Does anyone have a workaround for such issue? Migrating to WKWebview is not an option for us at this stage.
Is there any way to force iPad to use UIPickerView for dropdowns as per iPhone temporarily?
I have investigated suggestions in other stack overflow posts with no luck, for example:
ios 11 Beta 5 select drop-down list issue

We ran into the same bug. Apple's documentation says that any app iOS 8+ should be using WKWebView. Once we switched to WKWebView, we are no longer seeing this issue.

I ran into this issue, with a WKWebView that was being added into an UIWindow directly. My problem was that the view didn't have an UIViewcontroller linked to it, so the following lines did the trick:
containerVC = [[UIViewController alloc] init];
[containerVC.view addSubview:myWkWebview];
[window addSubview:containerVC.view];
Instead of adding myWkWebview directly to the window. With this, modal views were added again :-)

Related

Xcode 8: Terminating with Uncaught exception of type NSException

I'm a newbie and i'm having this error, i looked up everywhere and i can't find the solution. Any help would be really appreciated!
0 CoreFoundation 0x00000001102bb34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010d61c21e objc_exception_throw + 48
2 CoreFoundation 0x00000001102bb299 -[NSException raise] + 9
3 Foundation 0x000000010d12c2ff -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x000000010dbafc01 -[UIView(CALayerDelegate) setValue:forKey:] + 173
5 UIKit 0x000000010def9be6 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000110260590 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x000000010def856a -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x000000010dc451e8 -[UITableView _dequeueReusableViewOfType:withIdentifier:] + 399
9 UIKit 0x000000010dc456e0 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 71
10 Foodtracker 0x000000010d0274e7 _TFC11Foodtracker23MealTableViewController9tableViewfTCSo11UITableView12cellForRowAtV10Foundation9IndexPath_CSo15UITableViewCell + 199
11 Foodtracker 0x000000010d027a97 _TToFC11Foodtracker23MealTableViewController9tableViewfTCSo11UITableView12cellForRowAtV10Foundation9IndexPath_CSo15UITableViewCell + 87
12 UIKit 0x000000010dc58ba9 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 757
13 UIKit 0x000000010dc58e07 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
14 UIKit 0x000000010dc2c871 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3295
15 UIKit 0x000000010dc62189 -[UITableView _performWithCachedTraitCollection:] + 110
16 UIKit 0x000000010dc489e3 -[UITableView layoutSubviews] + 222
17 UIKit 0x000000010dbb0344 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
18 QuartzCore 0x000000011306acdc -[CALayer layoutSublayers] + 146
19 QuartzCore 0x000000011305e7a0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
20 QuartzCore 0x000000011305e61e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
21 QuartzCore 0x0000000112fec62c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
22 QuartzCore 0x0000000113019713 _ZN2CA11Transaction6commitEv + 475
23 QuartzCore 0x000000011301a083 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
24 CoreFoundation 0x000000011025fe17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
25 CoreFoundation 0x000000011025fd87 __CFRunLoopDoObservers + 391
26 CoreFoundation 0x00000001102444b6 CFRunLoopRunSpecific + 454
27 UIKit 0x000000010dae5db6 -[UIApplication _run] + 434
28 UIKit 0x000000010daebf34 UIApplicationMain + 159
29 Foodtracker 0x000000010d028c4f main + 111
30 libdyld.dylib 0x00000001111e568d start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Check your storyboard: All the IBAction, IBOutlet connected and with their current names? It's actually happens when problem with iboutlets
If you just updated to Swift 4 and have issues running your app on iOS 11 device or simulator, maybe you have the same issue I had with the UIVisualEffectView, and specifically with adding subviews to it.
Apple's documentation says:
Add subviews to the contentView and not to UIVisualEffectView
directly.
Basically, instead of adding subviews directly to the UIVisualEffectView, add them to its .contentView.
Example:
// create UIVisualEffectView
let blackBlur = UIVisualEffectView(effect: UIBlurEffect(style: .dark))
// adding a subview - this worked on iOS 10 - crashes the app on iOS 11
blackBlur.addSubview(someView)
// this works on both iOS 10 and iOS 11
blackBlur.contentView.addSubview(someView)
I hope this helps someone since it took me a while to figure this one out.
If anyone is running into this problem make sure that you
Go to Main.storyboard
RIGHT click on the yellow box icon (view controller) at the top of the phone outline
DELETE the outlet(s) with yellow flags.
What happens in instances like this is you probably named an action, then renamed it. You need to delete the old name and if that was the only issue will start right up in simulator!
NOTE: most of the time this happens because of wrong connection so double check and make sure all outlet connections are correct.
The raising method is setValue:forKey:, which is called after a table view cell was dequeued.
Apparently in the MealTableViewController.
Check your table view cells XIB, there might be an IBOutlet remaining with a wrong name, or maybe a property set with the wrong name.
If you are using Firebase and have this problem when you upload be careful with the key value. The keys should not include '#' or '%' or etc. I just deleted and worked fine.

iOS Exception Backtrace - App entry not symbolicating

I have received the below exception backtrace from Apple for an app I had submitted to the app store. I have symbolicated the log but my app's entry has not symbolicated. Any idea what I can do to achieve that? Please see Entry # 14 below which provides more detail. Any help would be much appreciated
Last Exception Backtrace:
0 CoreFoundation 0x1810cadb0 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18072ff80 objc_exception_throw + 56
2 UIKit 0x186b6d268 -[UIPopoverPresentationController presentationTransitionWillBegin] + 2884
3 UIKit 0x186581fb0 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1640
4 UIKit 0x1865800c8 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 332
5 UIKit 0x1864d30c8 _runAfterCACommitDeferredBlocks + 292
6 UIKit 0x1864e0a80 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
7 UIKit 0x1862125a4 _afterCACommitHandler + 96
8 CoreFoundation 0x181080728 _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
9 CoreFoundation 0x18107e4cc __CFRunLoopDoObservers + 372
10 CoreFoundation 0x18107e8fc __CFRunLoopRun + 928
11 CoreFoundation 0x180fa8c50 CFRunLoopRunSpecific + 384
12 GraphicsServices 0x182890088 GSEventRunModal + 180
13 UIKit 0x18628a088 UIApplicationMain + 204
14 MyApp 0x1000fb144 0x1000e4000 + 94532
15 libdyld.dylib 0x180b468b8 start + 4
Finally solved the problem. I was invoking UIAlertController in my code to present an action sheet with various options. To cater to devices that don't have a camera, I had added a conditional statement to directly present an ImagePicker instead of an action sheet.
iPAD testing was carried out only on the simulator which doesn't have a camera, thus directly invoking the ImagePicker. When he Conditional statement was removed, it tried presenting the Action Sheet through a PopoverPresentationController and crashed - as is evident in statement 2 of the Exception Backtrace.
I subsequently added the following code to fix the oversight:
if let popOver = optionMenu.popoverPresentationController {
popOver.sourceRect = sender.bounds
popOver.sourceView = sender
}

Terminating app: Could not load NIB in bundle: 'NSBundle ...' with name '7bK-jq-Zjz-view-r7i-6Z-zg0'

The app runs fine when run on in the iphone simulator, but running it in the ipad retina simulator, I see this crash:
2015-04-15 18:39:13.814 [17308:2881892] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle .app> (loaded)' with name '7bK-jq-Zjz-view-r7i-6Z-zg0''
Not sure what is going on. I do not have nib/xib files with this weird name: '7bK-jq-Zjz-view-r7i-6Z-zg0'
It has been some time since I tried running the ipad simulator. I the meantime some big changes took place (which I am not sure if it resulted in this issue):
1. Renamed the project
2. Upgraded to Swift 1.2 . It does not help reverting the project to before this change, since Sift is already on 1.2.
How would I go about troubleshooting it?
UPDATE
I looked in the storyboard source (as per Kamal's suggestion) and found that '7bK-jq-Zjz' was the ID of a table view controller (this controller is the first tab of a tab bar controller, which in turn is the master view of a split view controller).
The second part of the weird code, 'r7i-6Z-zg0', turned out to be the ID of the table view inside the mentioned table view controller.
I tried two things:
Recreated the split view controller and tab bar controller. Same crash seen with the ipad simulator (still iphone simulator running fine).
Recreated the troublesome table view controller. Still see the same crash, now with a different code/signature since the ID's are now new (for newly created table and table view controller).
Here is the new crash:
2015-04-17 22:10:01.427 [33373:6444860] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle .app> (loaded)' with name '3hh-RB-vwq-view-1d1-Kq-Vzm''
As mentioned iPhone simulators run fine - iPads not. But the iPhone 6 plus sometimes crashes when orientating to landscape mode (i.e. when the split view is not collapsed).
-- end update
*** First throw call stack:
(
0 CoreFoundation 0x0031f746 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x01f33a97 objc_exception_throw + 44
2 CoreFoundation 0x0031f66d +[NSException raise:format:] + 141
3 UIKit 0x0109fe2f -[UINib instantiateWithOwner:options:] + 1003
4 UIKit 0x00eba124 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
5 UIKit 0x00eba8bb -[UIViewController loadView] + 295
6 UIKit 0x010c069e -[UITableViewController loadView] + 77
7 UIKit 0x00ebaaef -[UIViewController loadViewIfRequired] + 78
8 UIKit 0x00ebb095 -[UIViewController view] + 35
9 UIKit 0x00f0ad2f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 426
10 UIKit 0x00f0a36f -[UITabBarController transitionFromViewController:toViewController:] + 64
11 UIKit 0x00f0652b -[UITabBarController _setSelectedViewController:] + 339
12 UIKit 0x00f062e5 -[UITabBarController setSelectedIndex:] + 115
13 UIKit 0x00f05e91 __51-[UITabBarController _setViewControllers:animated:]_block_invoke394 + 43
14 UIKit 0x00ddfd4f +[UIView(Animation) performWithoutAnimation:] + 82
15 UIKit 0x00f05d3d -[UITabBarController _setViewControllers:animated:] + 3627
16 UIKit 0x00f04403 -[UITabBarController _updateLayoutForTraitCollection:] + 302
17 UIKit 0x00f03e73 __80-[UITabBarController willTransitionToTraitCollection:withTransitionCoordinator:]_block_invoke + 69
18 UIKit 0x0125f107 -[_UIViewControllerNullAnimationTransitionCoordinator _applyBlocks:releaseBlocks:] + 198
19 UIKit 0x0125ed9a -[_UIViewControllerNullAnimationTransitionCoordinator _runAlongsideAnimations] + 148
20 UIKit 0x00ed8063 -[UIViewController(UIContainerViewControllerProtectedMethods) setOverrideTraitCollection:forChildViewController:] + 399
21 UIKit 0x01248a10 -[UISplitViewController _setMasterOverrideTraitCollectionActive:] + 127
22 UIKit 0x0124435a -[UISplitViewController initWithCoder:] + 112
23 UIKit 0x0122392e UINibDecoderDecodeObjectForValue + 739
24 UIKit 0x01223643 -[UINibDecoder decodeObjectForKey:] + 371
25 UIKit 0x010a0c1a -[UIRuntimeConnection initWithCoder:] + 189
26 UIKit 0x0122392e UINibDecoderDecodeObjectForValue + 739
27 UIKit 0x01223b30 UINibDecoderDecodeObjectForValue + 1253
28 UIKit 0x01223643 -[UINibDecoder decodeObjectForKey:] + 371
29 UIKit 0x0109fed0 -[UINib instantiateWithOwner:options:] + 1164
30 UIKit 0x0135d185 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
31 UIKit 0x0135d301 -[UIStoryboard instantiateInitialViewController] + 74
32 UIKit 0x00d556fc -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
33 UIKit 0x00d55984 -[UIApplication _loadMainInterfaceFile] + 245
34 UIKit 0x00d542f4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337
35 UIKit 0x00d6d93e __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
36 UIKit 0x00d5304a -[UIApplication workspaceDidEndTransaction:] + 155
37 FrontBoardServices 0x0451ec9e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
38 FrontBoardServices 0x0451e72f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
39 FrontBoardServices 0x04530d7c __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 30
40 CoreFoundation 0x00241050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
41 CoreFoundation 0x00236963 __CFRunLoopDoBlocks + 195
42 CoreFoundation 0x002367bb __CFRunLoopRun + 2715
43 CoreFoundation 0x00235a5b CFRunLoopRunSpecific + 443
44 CoreFoundation 0x0023588b CFRunLoopRunInMode + 123
45 UIKit 0x00d52a02 -[UIApplication _run] + 571
46 UIKit 0x00d56106 UIApplicationMain + 1526
47 IDZZZ 0x000a3ad4 main + 180
48 libdyld.dylib 0x02644ac9 start + 1
I had this issue starting with iOS 8.3 and finally solved it yesterday. I had hoped the issue would be fixed in iOS 8.4 but it isn't so I'm assuming it isn't considered a bug.
I have a UISplitViewController with 2 UINavigationControllers as the master/detail views. The master view UINavigationController has a UITabBarController. When this was failing, there were 3 UITableViewControllers as the child views for the UITabBarController. The error was exactly what you have: iOS 8.3+ throws an error trying to load the first child view of the tab bar even though the "nib" is definitely there in the storyboard and works fine on iPhone.
The fix for me was to insert a UINavigationController between the UITabBarController and each of the UITableViewController child views. So instead of UITabBarController with "view controller" relationships to 3 UITableViewControllers, the UITabBarController now has "view controllers" relationships to 3 UINavigationControllers and each of those UINavigationControllers have "root view controller" relationships to one of the UITableViewControllers.
This may be too late but I hope it helps someone.
Are you using UISplitController? In this case I solved my issue removing the storyboard segue for master and detail and adding them programmatically
Are you sure you included everything? Make sure to select all the storyboards and add to membership, in side bar, first tab.

AMSlideMenu crash: Receiver (<MenuViewController: 0x10db0da10>) has no segue with identifier 'rightMenu'

I know there is already a question about this, but the answer provided did not solve my problem.
For start, I had 3 three segues pointing to 3 different view controllers and coming from the AMSlideMenuLeftTableViewController class. The first segue and view controller that I created was the view that appeared as the first view (the one that shows when the app loads).
However, since I deleted that first view my app crashes immediately after opening it up.
This is the crash log:
2014-09-02 17:17:56.200 App[3174:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MenuViewController>: 0x10db0da10>) has no segue with identifier 'rightMenu''
*** First throw call stack:
(
0 CoreFoundation 0x0000000100433495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001030f499e objc_exception_throw + 43
2 UIKit 0x0000000101d99515 -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 App 0x000000010002d67f -[AMSlideMenuMainViewController setup] + 1071
4 App 0x000000010002aae1 -[AMSlideMenuMainViewController viewDidLoad] + 353
5 App 0x00000001000915e6 -[MenuViewController viewDidLoad] + 54
6 UIKit 0x0000000101d9759e -[UIViewController loadViewIfRequired] + 562
7 UIKit 0x0000000101d97777 -[UIViewController view] + 29
8 UIKit 0x00000001020a22e2 -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 390
9 UIKit 0x0000000101cddffa -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1109
10 UIKit 0x0000000101cddb9f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 36
11 UIKit 0x0000000101cddaef -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 101
12 UIKit 0x0000000101cdcdfe -[UIWindow _updateToInterfaceOrientation:duration:force:] + 377
13 UIKit 0x0000000101d9b70a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 147
14 UIKit 0x0000000101cd7b1b -[UIWindow addRootViewControllerViewIfPossible] + 490
15 UIKit 0x0000000101cd7c70 -[UIWindow _setHidden:forced:] + 282
16 UIKit 0x0000000101ce0ffa -[UIWindow makeKeyAndVisible] + 51
17 UIKit 0x0000000101c9cc98 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1788
18 UIKit 0x0000000101ca0a0c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
19 UIKit 0x0000000101cb1d4c -[UIApplication handleEvent:withNewEvent:] + 3189
20 UIKit 0x0000000101cb2216 -[UIApplication sendEvent:] + 79
21 UIKit 0x0000000101ca2086 _UIApplicationHandleEvent + 578
22 GraphicsServices 0x0000000104eff71a _PurpleEventCallback + 762
23 GraphicsServices 0x0000000104eff1e1 PurpleEventCallback + 35
24 CoreFoundation 0x00000001003b5679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
25 CoreFoundation 0x00000001003b544e __CFRunLoopDoSource1 + 478
26 CoreFoundation 0x00000001003de903 __CFRunLoopRun + 1939
27 CoreFoundation 0x00000001003ddd83 CFRunLoopRunSpecific + 467
28 UIKit 0x0000000101ca02e1 -[UIApplication _run] + 609
29 UIKit 0x0000000101ca1e33 UIApplicationMain + 1010
30 App 0x0000000100076503 main + 115
31 libdyld.dylib 0x0000000103ddd5fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I think the problem is that the app is trying to display the view I deleted as the main view but it isn't there. The fact is that I have not found any reference to that old view I deleted.
If AMSlideMenu catches an exception when trying to create LeftMenu, it then tries to create RightMenu (I don't understand why, but is true).
In my case the left menu firstSegue pointed to a 'wrong view', because it was a simple view controller, not a navigation controller. I changed the view controller to a navigation controller (that points to my original view controller), and that fixed it.
Copy the AMSlideMenuWithoutStoryboard-Prefix.pch file settings to the PCH file from your project.

iOS Simulator is black on app execution

I am running xcode 5.1.1 and have been trying to learn objective C / iOS development. Right now whenever I try to run my code on the emulator (I do not have an actual device atm) it comes up with a black screen. Code can be found here. Compiling and running gives me the following error:
2014-08-23 10:42:57.429 Calculator[1862:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<XYZViewController 0xe436640> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key didgetPressed.'
*** First throw call stack:
(
0 CoreFoundation 0x017ed1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0156c8e5 objc_exception_throw + 44
2 CoreFoundation 0x0187cfe1 -[NSException raise] + 17
3 Foundation 0x0122cd9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x011991d7 _NSSetUsingKeyValueSetter + 88
5 Foundation 0x01198731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x011fab0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x004e31f4 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x0157e7de -[NSObject performSelector:] + 62
9 CoreFoundation 0x017e876a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x004e1d4d -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x0034a6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
12 UIKit 0x0034ae9d -[UIViewController loadView] + 302
13 UIKit 0x0034b0d3 -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x0034b5d9 -[UIViewController view] + 35
15 UIKit 0x0026b267 -[UIWindow addRootViewControllerViewIfPossible] + 66
16 UIKit 0x0026b5ef -[UIWindow _setHidden:forced:] + 312
17 UIKit 0x0026b86b -[UIWindow _orderFrontWithoutMakingKey] + 49
18 UIKit 0x002763c8 -[UIWindow makeKeyAndVisible] + 65
19 UIKit 0x00226bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
20 UIKit 0x0022b667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
21 UIKit 0x0023ff92 -[UIApplication handleEvent:withNewEvent:] + 3517
22 UIKit 0x00240555 -[UIApplication sendEvent:] + 85
23 UIKit 0x0022d250 _UIApplicationHandleEvent + 683
24 GraphicsServices 0x037e2f02 _PurpleEventCallback + 776
25 GraphicsServices 0x037e2a0d PurpleEventCallback + 46
26 CoreFoundation 0x01768ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
27 CoreFoundation 0x017689db __CFRunLoopDoSource1 + 523
28 CoreFoundation 0x0179368c __CFRunLoopRun + 2156
29 CoreFoundation 0x017929d3 CFRunLoopRunSpecific + 467
30 CoreFoundation 0x017927eb CFRunLoopRunInMode + 123
31 UIKit 0x0022ad9c -[UIApplication _run] + 840
32 UIKit 0x0022cf9b UIApplicationMain + 1225
33 Calculator 0x00002c8d main + 141
34 libdyld.dylib 0x01e34701 start + 1
35 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I have attempted the following things, and so far nothing has worked
1) checked the deployment info, it has the main interface set to main
2) double checked all break points to turn them off and disabled all of them through Debug->Disable Breakpoints
3) Reset Content and Settings on the iOS Simulator.
4) Checked the issue with the LLDB Debugger, however from what I have read the issue is no longer present with the 5.1.1 xcode.
5) checked the local host is still set to 127.0.0.1
Thanks!
- Terryn
I checked out your project. The IBActions for the digits (didgetPressed:) are connected correctly, but the IBOutlets are not connected correctly (the property didgetPressed does not exist).
It will work when you delete the referencing outlets in the storyboard (see picture).
This error message tells us what's wrong:
2014-08-23 10:42:57.429 Calculator[1862:60b] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key didgetPressed.'
From this we can deduce that, in your storyboard (or xib), you have an object of class XYZViewController. That object once had an outlet named didgetPressed, and you connected that outlet to something else in the storyboard.
Later, you changed something about your project that removed the didgetPressed outlet from that object, but you didn't disconnect the outlet in your storyboard. For example, maybe you changed the outlet name in your Objective-C code to didGetPressed, or maybe you deleted the outlet and changed it to an action, or maybe you changed the object's class (and the prior class had the didgetPressed outlet).
You need to find the XYZViewController object in your storyboard and disconnect the didgetPressed outlet.
The error is self explanatory you can remove that by opening storyboard select XYZViewController goto connection inspector under Utilities panel and remove binding of didgetPressed.
I have check you code just select button with 7 as title and remove it's referencing outlet and run again it will work.

Resources