HandleLongPress : UIPopoverController dealloc reached while popover is still visible - xcode

I'm trying to develop a Mapkit app. There is a map, a lot of annotations located on this map. If I touch one of these annotations my app is displaying a custom popover from a storyboard. If I touch another location on view while popover is active, popover disappears without any problem.
But, if I touch one of annotation and move my finger out of annotation without releasing my finger, I got the error.
2014-08-01 11:33:34.160 notamTR[1101:60b] *** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'
*** First throw call stack:
(
0 CoreFoundation 0x01b231e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x018208e5 objc_exception_throw + 44
2 CoreFoundation 0x01b22fbb +[NSException raise:format:] + 139
3 UIKit 0x00ae195e -[UIPopoverController dealloc] + 86
4 libobjc.A.dylib 0x01831692 _ZN11objc_object17sidetable_releaseEb + 268
5 libobjc.A.dylib 0x01830e81 objc_release + 49
6 myMap 0x0000b82d -[ViewController mapView:didSelectAnnotationView:] + 1885
7 MapKit 0x0017799d -[MKMapView annotationManager:didSelectAnnotationRepresentation:] + 704
8 MapKit 0x001ae9b8 -[MKAnnotationManager selectAnnotation:animated:avoid:] + 715
9 MapKit 0x001ae6e8 -[MKAnnotationManager selectAnnotation:animated:] + 75
10 MapKit 0x00165206 -[MKMapView handleLongPress:] + 993
11 UIKit 0x0087c4f4 _UIGestureRecognizerSendActions + 230
12 UIKit 0x0087b168 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
13 UIKit 0x0087cbdd -[UIGestureRecognizer _delayedUpdateGesture] + 60
14 UIKit 0x0088013d ___UIGestureRecognizerUpdate_block_invoke + 57
15 UIKit 0x008800be _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
16 UIKit 0x008767ac _UIGestureRecognizerUpdate + 199
17 UIKit 0x00521a5a -[UIWindow _sendGesturesForEvent:] + 1291
18 UIKit 0x00522971 -[UIWindow sendEvent:] + 1021
19 UIKit 0x004f45f2 -[UIApplication sendEvent:] + 242
20 UIKit 0x004de353 _UIApplicationHandleEventQueue + 11455
21 CoreFoundation 0x01aac77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
22 CoreFoundation 0x01aac10b __CFRunLoopDoSources0 + 235
23 CoreFoundation 0x01ac91ae __CFRunLoopRun + 910
24 CoreFoundation 0x01ac89d3 CFRunLoopRunSpecific + 467
25 CoreFoundation 0x01ac87eb CFRunLoopRunInMode + 123
26 GraphicsServices 0x032df5ee GSEventRunModal + 192
27 GraphicsServices 0x032df42b GSEventRun + 104
28 UIKit 0x004e0f9b UIApplicationMain + 1225
29 myMap 0x0001c37c main + 92
30 libdyld.dylib 0x020e4701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

It is quite late with this Answer, but for those looking for a solution: Try to create a storong property to hold this popover, and then when taping on the map accessory use the self.popover reference to init it with a content.

Related

xcode animation transition error

When i try setting my animation to 'push' from a view controller that has a navigation controller to a view controller without one or to a view controller with a navigation controller, this error pops up. but when i use the animation 'show' or 'show detail' they work perfectly fine. I have tried other methods to fix this by deleting the outlet segue with the exclamation mark but my outlet segues dont have any of those symbols showing up....
2016-06-15 23:24:46.546 Travel_Log[667:9045] Failed to set (keyPath) user defined inspected property on (UITextField): [<UITextField 0x7fe6e3759b90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.
2016-06-15 23:24:49.922 Travel_Log[667:9045] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105d35d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107d1edeb objc_exception_throw + 48
2 UIKit 0x00000001069858c9 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 0
3 UIKit 0x0000000106984bf5 -[UINavigationController pushViewController:animated:] + 848
4 UIKit 0x0000000106f6fc44 __66-[UIStoryboardPushSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 1660
5 UIKit 0x0000000106ee9630 -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 460
6 UIKit 0x0000000106ee9433 -[UIStoryboardSegueTemplate _perform:] + 82
7 UIKit 0x0000000106ee96f7 -[UIStoryboardSegueTemplate perform:] + 156
8 UIKit 0x00000001067a3a8d -[UIApplication sendAction:to:from:forEvent:] + 92
9 UIKit 0x0000000106916e67 -[UIControl sendAction:to:forEvent:] + 67
10 UIKit 0x0000000106917143 -[UIControl _sendActionsForEvents:withEvent:] + 327
11 UIKit 0x0000000106916263 -[UIControl touchesEnded:withEvent:] + 601
12 UIKit 0x000000010681699f -[UIWindow _sendTouchesForEvent:] + 835
13 UIKit 0x00000001068176d4 -[UIWindow sendEvent:] + 865
14 UIKit 0x00000001067c2dc6 -[UIApplication sendEvent:] + 263
15 UIKit 0x000000010679c553 _UIApplicationHandleEventQueue + 6660
16 CoreFoundation 0x0000000105c5b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 CoreFoundation 0x0000000105c5122c __CFRunLoopDoSources0 + 556
18 CoreFoundation 0x0000000105c506e3 __CFRunLoopRun + 867
19 CoreFoundation 0x0000000105c500f8 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x000000010b683ad2 GSEventRunModal + 161
21 UIKit 0x00000001067a1f09 UIApplicationMain + 171
22 Travel_Log 0x0000000105ae8322 main + 114
23 libdyld.dylib 0x0000000109a4e92d start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Weird runtime error with iOS 8 and XCode 6 beta 4

We have a UITableView object in our storyboard that is assigned to a custom class. When I load the view and try to select a row, the application crashes. I've been putting breakpoints up and down my class—the most intuitive one being at didSelectRowAtIndexPath—but all of this is to no avail. App just crashes before I get to any of my breakpoints.
This bug only exists in iOS8. Runs fine in iOS7. Any ideas what is causing this? Below is a log of my console.
CoreData: warning: Property 'year' is a 64 bit scalar type on class 'Term' that does not match its entity's property's 32 bit scalar type. Implicit coercion to 32 bits in the database is not recommended.
2014-08-04 13:45:47.415 Grades[29475:2823481] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fb9728ba400> should have parent view controller:<SyllabusDetailViewController: 0x7fb9706a96a0> but requested parent is:<UIInputWindowController: 0x7fb97086fa00>'
*** First throw call stack:
(
0 CoreFoundation 0x0000000108fcfc35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001088c2a1c objc_exception_throw + 45
2 CoreFoundation 0x0000000108fcfb6d +[NSException raise:format:] + 205
3 UIKit 0x00000001070b348d -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 184
4 UIKit 0x000000010764a4a2 -[UIInputWindowController changeToInputViewSet:] + 435
5 UIKit 0x000000010764b07a __43-[UIInputWindowController setInputViewSet:]_block_invoke + 85
6 UIKit 0x0000000106ffdb9e +[UIView(Animation) performWithoutAnimation:] + 65
7 UIKit 0x000000010764ae4b -[UIInputWindowController setInputViewSet:] + 288
8 UIKit 0x0000000107646e3b -[UIInputWindowController performOperations:withAnimationStyle:] + 50
9 UIKit 0x000000010744214e -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 1054
10 UIKit 0x00000001070ff32d -[UIResponder becomeFirstResponder] + 468
11 UIKit 0x0000000106ff9453 -[UIView(Hierarchy) becomeFirstResponder] + 99
12 UIKit 0x00000001076a4a0f -[UITextField becomeFirstResponder] + 51
13 UIKit 0x000000010733d3d1 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 177
14 UIKit 0x000000010733f440 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 2263
15 UIKit 0x0000000107334b5d _UIGestureRecognizerSendActions + 262
16 UIKit 0x0000000107333134 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1095
17 UIKit 0x0000000107338556 ___UIGestureRecognizerUpdate_block_invoke690 + 371
18 UIKit 0x0000000107338312 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 254
19 UIKit 0x000000010732d87b _UIGestureRecognizerUpdate + 2858
20 UIKit 0x0000000106fd3b36 -[UIWindow _sendGesturesForEvent:] + 1041
21 UIKit 0x0000000106fd4763 -[UIWindow sendEvent:] + 667
22 UIKit 0x0000000106fa1811 -[UIApplication sendEvent:] + 246
23 UIKit 0x0000000106fae8ae _UIApplicationHandleEventFromQueueEvent + 17707
24 UIKit 0x0000000106f8a009 _UIApplicationHandleEventQueue + 1967
25 CoreFoundation 0x0000000108f057f1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
26 CoreFoundation 0x0000000108efb16d __CFRunLoopDoSources0 + 269
27 CoreFoundation 0x0000000108efa7a4 __CFRunLoopRun + 868
28 CoreFoundation 0x0000000108efa1d6 CFRunLoopRunSpecific + 470
29 GraphicsServices 0x000000010b330a3a GSEventRunModal + 161
30 UIKit 0x0000000106f8d280 UIApplicationMain + 1282
31 Grades 0x0000000106300003 main + 115
32 libdyld.dylib 0x00000001095ea145 start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Okay, fixed the problem. Had some bad CONTRL+drag connections between my Storyboard objects and my IBOutlets. Turned those off and now the problem is gone.

Xcode Storyboard - UITableViewCell UISwitch Value Changed

I have am using Xcode storyboards and have a View Controller that has a UITableView which in turn has a custom UITableViewCell.
The UITableViewCell has a UISwitch in it and I want to know when the value has changed. I have a IBAction that successfully fires when the value is changed
- (IBAction)updateSwitchAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(#"In SettingsViewcontroller updateSwitchAtIndexPath row=|%d \n", indexPath.row);
}
However when it fires the app terminates
2014-07-10 23:38:10.037 reactor[2572:60b] -[UISwitch row]: unrecognized selector sent to instance 0x944b7e0
2014-07-10 23:38:10.072 reactor[2572:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISwitch row]: unrecognized selector sent to instance 0x944b7e0'
*** First throw call stack:
(
0 CoreFoundation 0x01a281e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015758e5 objc_exception_throw + 44
2 CoreFoundation 0x01ac5243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01a1850b ___forwarding___ + 1019
4 CoreFoundation 0x01a180ee _CF_forwarding_prep_0 + 14
5 positivity 0x00003807 -[SettingsViewController updateSwitchAtIndexPath:] + 87
6 libobjc.A.dylib 0x0158782b -[NSObject performSelector:withObject:] + 70
7 UIKit 0x002373b9 -[UIApplication sendAction:to:from:forEvent:] + 108
8 UIKit 0x00237345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
9 UIKit 0x00338bd1 -[UIControl sendAction:to:forEvent:] + 66
10 UIKit 0x00338fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
11 UIKit 0x004c97a5 __31-[UISwitch _handleLongPressNL:]_block_invoke + 85
12 UIKit 0x004c8666 -[_UISwitchInternalViewNeueStyle1 _setPressed:on:animated:shouldAnimateLabels:completion:] + 243
13 UIKit 0x004c9681 -[UISwitch _handleLongPressNL:] + 286
14 UIKit 0x005d14f4 _UIGestureRecognizerSendActions + 230
15 UIKit 0x005d0168 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
16 UIKit 0x005d1bdd -[UIGestureRecognizer _delayedUpdateGesture] + 60
17 UIKit 0x005d513d ___UIGestureRecognizerUpdate_block_invoke + 57
18 UIKit 0x005d50be _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
19 UIKit 0x005cb7ac _UIGestureRecognizerUpdate + 199
20 UIKit 0x00276a5a -[UIWindow _sendGesturesForEvent:] + 1291
21 UIKit 0x00277971 -[UIWindow sendEvent:] + 1021
22 UIKit 0x002495f2 -[UIApplication sendEvent:] + 242
23 UIKit 0x00233353 _UIApplicationHandleEventQueue + 11455
24 CoreFoundation 0x019b177f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25 CoreFoundation 0x019b110b __CFRunLoopDoSources0 + 235
26 CoreFoundation 0x019ce1ae __CFRunLoopRun + 910
27 CoreFoundation 0x019cd9d3 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x019cd7eb CFRunLoopRunInMode + 123
29 GraphicsServices 0x03a1c5ee GSEventRunModal + 192
30 GraphicsServices 0x03a1c42b GSEventRun + 104
31 UIKit 0x00235f9b UIApplicationMain + 1225
32 positivity 0x00005dbd main + 141
33 libdyld.dylib 0x0206f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any help would be greatly appreciated
UISwitch does not have a property called "row." The way your IBOutlet is set up, you will actually get an UISwitch object as a parameter instead of NSIndexPath.
The better thing to do here is to use the delegate pattern. That way, the custom cell can notify the UIViewController (containing the UITableView) that the switch has been pressed.
So it would be more like:
- (IBAction)updateSwitchAtIndexPath:(UISwitch *)mySwitch
{
// notify the delegate about the switch update
if ([self.delegate respondsToSelector:#selector(switchWasPressed:)]) {
[self.delegate switchWasPressed:mySwitch];
}
}

How to fix ios app crashing with certain name?

I have an app called "FirstAid" that crashes in the simulator and on a device. If I create a clean project called "FirstAid" that also crashes with the same report. Any other named app is fine.
I have done a clean, and rebuilt it but it still crashes.
How do I fix it?
2011-05-14 10:06:39.912 FirstAid[1217:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00ef55a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01049313 objc_exception_throw + 44
2 CoreFoundation 0x00ef54e1 -[NSException raise] + 17
3 Foundation 0x008c7677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x008c75e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0034330c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00e6b8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x00341d23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00343ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x0014917a -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x00149cf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x00154617 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x0014cabf -[UIApplication sendEvent:] + 71
13 UIKit 0x00151f2e _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x013ce992 PurpleEventCallback + 1550
15 CoreFoundation 0x00ed6944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00e36cf7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00e33f83 __CFRunLoopRun + 979
18 CoreFoundation 0x00e33840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00e33761 CFRunLoopRunInMode + 97
20 UIKit 0x001497d2 -[UIApplication _run] + 623
21 UIKit 0x00155c93 UIApplicationMain + 1160
22 FirstAid 0x00001cb9 main + 121
23 FirstAid 0x00001c35 start + 53
)
terminate called after throwing an instance of 'NSException'
This error may mean several things, but my bet is that some of your outlets (from IB) is broken. Examine your XIB-files + all their outlets and make sure they exist in your code as well.

Strange memory error in Xcode

I'm getting some strange memory errors in Xcode; it's accessing code from other apps which is very strange.
Here is the code:
[Session started at 2011-03-08 17:04:33 +0800.]
2011-03-08 17:04:59.438 Movie[5309:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MovieViewController" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00daebe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f035c2 objc_exception_throw + 47
2 CoreFoundation 0x00d67628 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d6759a +[NSException raise:format:] + 58
4 UIKit 0x00367b75 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x00365709 -[UIViewController loadView] + 120
6 UIKit 0x003655e3 -[UIViewController view] + 56
7 Movie 0x00002466 -[MovieAppDelegate application:didFinishLaunchingWithOptions:] + 79
8 UIKit 0x002b81fa -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
9 UIKit 0x002ba55e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
10 UIKit 0x002c4db2 -[UIApplication handleEvent:withNewEvent:] + 1533
11 UIKit 0x002bd202 -[UIApplication sendEvent:] + 71
12 UIKit 0x002c2732 _UIApplicationHandleEvent + 7576
13 GraphicsServices 0x016e4a36 PurpleEventCallback + 1550
14 CoreFoundation 0x00d90064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
15 CoreFoundation 0x00cf06f7 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x00ced983 __CFRunLoopRun + 979
17 CoreFoundation 0x00ced240 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00ced161 CFRunLoopRunInMode + 97
19 UIKit 0x002b9fa8 -[UIApplication _run] + 636
20 UIKit 0x002c642e UIApplicationMain + 1160
21 Movie 0x000023f4 main + 102
22 Movie 0x00002385 start + 53
)
terminate called after throwing an instance of 'NSException'
Can you tell me what this means?
Thanks in advance!
It says in plain english what the problem is: "[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MovieViewController" nib but the view outlet was not set". Set the view outlet in Interface Builder and that's it.

Resources