I used once a Swipe gesture on xCode 6 (using Swift). It worked well.
#IBAction func ArrasteiDireita(sender: UISwipeGestureRecognizer) {
println("Arrastei Direita")
}
I removed the gesture (in the main.storyboard) and trying to use Pan Gesture instead, but I don't know why the Swipe Gesture is still being required.
I am getting the following error if the associated method (ArrasteiDireita above) is commented:
2014-07-05 10:48:51.400 Verdadeiro ou Falso[51178:2926619] - [_TtC19Verdadeiro_ou_Falso4Jogo ArrasteiDireita:]: unrecognized selector sent to instance 0xb23bfa0
2014-07-05 10:48:51.402 Verdadeiro ou Falso[51178:2926619] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_TtC19Verdadeiro_ou_Falso4Jogo ArrasteiDireita:]: unrecognized selector sent to instance 0xb23bfa0'
*** First throw call stack:
(
0 CoreFoundation 0x00842646 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x0216d8e3 objc_exception_throw + 44
2 CoreFoundation 0x00849575 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x00794407 ___forwarding___ + 1047
4 CoreFoundation 0x00793fce _CF_forwarding_prep_0 + 14
5 UIKit 0x01466e63 _UIGestureRecognizerSendActions + 327
6 UIKit 0x0146509c -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1657
7 UIKit 0x0146772d -[UIGestureRecognizer _delayedUpdateGesture] + 60
8 UIKit 0x0146b1cc ___UIGestureRecognizerUpdate_block_invoke689 + 347
9 UIKit 0x0146af6d _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
10 UIKit 0x0145e0a8 _UIGestureRecognizerUpdate + 3786
11 UIKit 0x0108ff3b -[UIWindow _sendGesturesForEvent:] + 1356
12 UIKit 0x01090d9f -[UIWindow sendEvent:] + 769
13 UIKit 0x01056c29 -[UIApplication sendEvent:] + 242
14 UIKit 0x010665e2 _UIApplicationHandleEventFromQueueEvent + 20518
15 UIKit 0x0103bcc5 _UIApplicationHandleEventQueue + 2154
16 CoreFoundation 0x00766faf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x0075c34d __CFRunLoopDoSources0 + 253
18 CoreFoundation 0x0075b8a8 __CFRunLoopRun + 952
19 CoreFoundation 0x0075b22b CFRunLoopRunSpecific + 443
20 CoreFoundation 0x0075b05b CFRunLoopRunInMode + 123
21 GraphicsServices 0x0417e3ca GSEventRunModal + 192
22 GraphicsServices 0x0417e207 GSEventRun + 104
23 UIKit 0x0103f6e5 UIApplicationMain + 1526
24 Verdadeiro ou Falso 0x0000d591 top_level_code + 97
25 Verdadeiro ou Falso 0x0000d5cb main + 43
26 libdyld.dylib 0x026aeac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Since Swipe gesture occurs before the Pan Gesture, I am not being able to reach the Pan Gesture method:
#IBAction func Arrastei(sender: UIPanGestureRecognizer) {
println("Arrastado")
}
Is there any other place I need to remove the reference to Swipe Gesture?
Related
Here's what I did: I control dragged from the button to the viewController and starting the app is fine. However, when I click the "let's get started" button, which should segue into the next part of the app, I just get an error. What am I doing wrong?
Latest version of xcode (not beta) and code I wrote (I didn't write any code for the segue though) was in swift.
Also, the error message I'm getting
Registration for remote notification failed with error: REMOTE_NOTIFICATION_SIMULATOR_NOT_SUPPORTED_NSERROR_DESCRIPTION
2016-07-28 14:20:53.108 TouchLogin[6368:503476] -[TouchLogin.BWWalkthroughPageViewController GetStarted:]: unrecognized selector sent to instance 0x7f8cc351b360
2016-07-28 14:20:53.111 TouchLogin[6368:503476] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TouchLogin.BWWalkthroughPageViewController GetStarted:]: unrecognized selector sent to instance 0x7f8cc351b360'
*** First throw call stack:
(
0 CoreFoundation 0x000000010132bd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000103310deb objc_exception_throw + 48
2 CoreFoundation 0x0000000101334d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010127acfa ___forwarding___ + 970
4 CoreFoundation 0x000000010127a8a8 _CF_forwarding_prep_0 + 120
5 UIKit 0x0000000101d96a8d -[UIApplication sendAction:to:from:forEvent:] + 92
6 UIKit 0x0000000101f09e67 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x0000000101f0a143 -[UIControl _sendActionsForEvents:withEvent:] + 327
8 UIKit 0x0000000101f09263 -[UIControl touchesEnded:withEvent:] + 601
9 UIKit 0x000000010227ec52 _UIGestureRecognizerUpdate + 10279
10 UIKit 0x0000000101e0948e -[UIWindow _sendGesturesForEvent:] + 1137
11 UIKit 0x0000000101e0a6c4 -[UIWindow sendEvent:] + 849
12 UIKit 0x0000000101db5dc6 -[UIApplication sendEvent:] + 263
13 UIKit 0x0000000101d8f553 _UIApplicationHandleEventQueue + 6660
14 CoreFoundation 0x0000000101251301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15 CoreFoundation 0x000000010124722c __CFRunLoopDoSources0 + 556
16 CoreFoundation 0x00000001012466e3 __CFRunLoopRun + 867
17 CoreFoundation 0x00000001012460f8 CFRunLoopRunSpecific + 488
18 GraphicsServices 0x000000010496dad2 GSEventRunModal + 161
19 UIKit 0x0000000101d94f09 UIApplicationMain + 171
20 TouchLogin 0x0000000100fa6cc2 main + 114
21 libdyld.dylib 0x000000010437192d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Working on implementing NSUndoManager within an iOS9 app. Current undo code looks like this:
func setActiveColorData(colorData: ColorData) {
if colorData != activeColorData {
print(self)
undoManager?.registerUndoWithTarget(self, selector: "setActiveColorData:", object: activeColorData!)
undoManager?.setActionName("Change color")
print("Set undo action")
activeColorData = colorData
}
}
ColorData is just a simple class with three floats inside of it (hue, saturation, brightness) and some utility methods.
Everything works fine, including the shake gesture which brings up the undo prompt. But once you click undo, the app crashes and the following error:
2016-02-25 16:26:58.225 Color[89399:5503615] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Color.PickerViewController setActiveColorData:]: unrecognized selector sent to instance 0x7fa080776820'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105b75e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108159deb objc_exception_throw + 48
2 CoreFoundation 0x0000000105b7e48d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000105acb90a ___forwarding___ + 970
4 CoreFoundation 0x0000000105acb4b8 _CF_forwarding_prep_0 + 120
5 Foundation 0x00000001066b2feb -[_NSUndoStack popAndInvoke] + 261
6 Foundation 0x00000001066b2162 -[NSUndoManager undoNestedGroup] + 424
7 UIKit 0x0000000106c46813 -[UIApplication alertView:clickedButtonAtIndex:] + 151
8 UIKit 0x0000000106f63589 -[UIAlertView _prepareToDismissForTappedIndex:] + 136
9 UIKit 0x0000000106f62fc7 __35-[UIAlertView _prepareAlertActions]_block_invoke50 + 53
10 UIKit 0x0000000106f54572 -[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:] + 133
11 UIKit 0x0000000107604eb6 -[_UIAlertControllerView _handleActionSelectionGestureRecognizer:] + 694
12 UIKit 0x000000010711ee73 _UIGestureRecognizerSendTargetActions + 153
13 UIKit 0x000000010711b4e5 _UIGestureRecognizerSendActions + 162
14 UIKit 0x00000001071194e2 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 843
15 UIKit 0x00000001071219a0 ___UIGestureRecognizerUpdate_block_invoke904 + 79
16 UIKit 0x000000010712183e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 342
17 UIKit 0x000000010710f101 _UIGestureRecognizerUpdate + 2634
18 UIKit 0x0000000106ca6f8a -[UIWindow _sendGesturesForEvent:] + 1137
19 UIKit 0x0000000106ca81c0 -[UIWindow sendEvent:] + 849
20 UIKit 0x0000000106c56b66 -[UIApplication sendEvent:] + 263
21 UIKit 0x0000000106c30d97 _UIApplicationHandleEventQueue + 6844
22 CoreFoundation 0x0000000105aa1a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
23 CoreFoundation 0x0000000105a9795c __CFRunLoopDoSources0 + 556
24 CoreFoundation 0x0000000105a96e13 __CFRunLoopRun + 867
25 CoreFoundation 0x0000000105a96828 CFRunLoopRunSpecific + 488
26 GraphicsServices 0x000000010a416ad2 GSEventRunModal + 161
27 UIKit 0x0000000106c36610 UIApplicationMain + 171
28 Color 0x00000001052a2a7d main + 109
29 libdyld.dylib 0x0000000108c9992d start + 1
30 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I've check the PickerViewController instance and the memory locations match up (from the print(self) line, in this case 0x7fa080776820). Any idea why it can't invoke this selector? Or is it something else? Thanks!
I'm seeing this same kind of crash in a photo editing app when memory is running low. When I get a memory warning, I clear the undo manager but in my case I believe this crash happens because the memory is getting deleted out from under the undo manager.
In case it's related: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/UndoArchitecture/Articles/CleaningUndoStack.html
I want to use sender to get the value from segmented control, but I am getting the unrecognized selector sent to instance error. The segmented control was added within a view. I've tried removing the semicolon and/or sender and none of the prior posts I've found seem to help. Any ideas?
Swift Code
var segCntrl = UISegmentedControl(items: ["Yes","No"])
segCntrl.tag = 100
segCntrl.center = CGPointMake(qView.bounds.width/2, qView.bounds.minY+40)
self.qView.addSubview(segCntrl)
func segmentorSwitch(sender: AnyObject) {
if(sender.selectedSegmentIndex == 1) {
println("Yes selected")
}
else if(sender.selectedSegmentIndex == 2) {
println("No selected")
}
}
segCntrl.addTarget(self, action: "segmentorSwitch:", forControlEvents: UIControlEvents.ValueChanged)
Error code:
2015-07-07 11:46:24.482 myApp [75641:1855377] -[[myApp.SegViewControllerr segmentorSwitch:]: unrecognized selector sent to instance 0x7fbb0a43b450
2015-07-07 11:46:24.489 myApp[75641:1855377] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[myApp.SegViewController segmentorSwitch:]: unrecognized selector sent to instance 0x7fbb0a43b450'
* First throw call stack:
(
0 CoreFoundation 0x00000001060dcc65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010838abb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001060e40ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010603a13c ___forwarding_ + 988
4 CoreFoundation 0x0000000106039cd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001070bfd62 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x00000001071d150a -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010724dfba -[UISegmentedControl _setSelectedSegmentIndex:notify:animate:] + 570
8 UIKit 0x000000010724ffbf -[UISegmentedControl touchesEnded:withEvent:] + 143
9 UIKit 0x000000010710c958 -[UIWindow _sendTouchesForEvent:] + 735
10 UIKit 0x000000010710d282 -[UIWindow sendEvent:] + 682
11 UIKit 0x00000001070d3541 -[UIApplication sendEvent:] + 246
12 UIKit 0x00000001070e0cdc _UIApplicationHandleEventFromQueueEvent + 18265
13 UIKit 0x00000001070bb59c _UIApplicationHandleEventQueue + 2066
14 CoreFoundation 0x0000000106010431 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
15 CoreFoundation 0x00000001060062fd __CFRunLoopDoSources0 + 269
16 CoreFoundation 0x0000000106005934 __CFRunLoopRun + 868
17 CoreFoundation 0x0000000106005366 CFRunLoopRunSpecific + 470
18 GraphicsServices 0x000000010cc5ba3e GSEventRunModal + 161
19 UIKit 0x00000001070be8c0 UIApplicationMain + 1282
20 myApp 0x0000000104d9a0c7 main + 135
21 libdyld.dylib 0x0000000109458145 start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Looks like segmentorSwitch: is implemented inside another method. Define it outside the method in which your code is contained, and this should be fixed.
my app crash whenever i swipe left on a cell, and this what i get
-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x166a1960
-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x166a1960
Stack Trace: (
0 CoreFoundation 0x2fc08f23 <redacted> + 154
1 libobjc.A.dylib 0x3a39fce7 objc_exception_throw + 38
2 CoreFoundation 0x2fc0c837 <redacted> + 202
3 CoreFoundation 0x2fc0b137 <redacted> + 706
4 CoreFoundation 0x2fb5a098 _CF_forwarding_prep_0 + 24
5 UIKit 0x3262ef91 <redacted> + 184
6 UIKit 0x325be3f5 <redacted> + 816
7 UIKit 0x32468a21 <redacted> + 148
8 UIKit 0x325ce0cf <redacted> + 78
9 UIKit 0x324681eb <redacted> + 458
10 UIKit 0x32467c4b <redacted> + 666
11 UIKit 0x3243ce75 <redacted> + 196
12 UIKit 0x3243b541 <redacted> + 7120
13 CoreFoundation 0x2fbd3fef <redacted> + 14
14 CoreFoundation 0x2fbd34b7 <redacted> + 206
15 CoreFoundation 0x2fbd1ca7 <redacted> + 630
16 CoreFoundation 0x2fb3c769 CFRunLoopRunSpecific + 524
17 CoreFoundation 0x2fb3c54b CFRunLoopRunInMode + 106
18 GraphicsServices 0x34aa96d3 GSEventRunModal + 138
19 UIKit 0x3249b891 UIApplicationMain + 1136
20 Event Receiver 0x000c3849 main + 116
21 libdyld.dylib 0x3a89dab7 <redacted> + 2
)
i tried to add a Symbolic Breakpoint for -[NSObject(NSObject) doesNotRecognizeSelector:] but that didnt show which piece of code sent that selector
update: this time i used the simulator, and tried to crash the app and i got this now:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x8e46570'
*** First throw call stack:
(
0 CoreFoundation 0x01ad91e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x018588e5 objc_exception_throw + 44
2 CoreFoundation 0x01b76243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01ac950b ___forwarding___ + 1019
4 CoreFoundation 0x01ac90ee _CF_forwarding_prep_0 + 14
5 UIKit 0x00785f7a -[UITableViewCellScrollView gestureRecognizerShouldBegin:] + 203
6 UIKit 0x008b5466 -[UIGestureRecognizer _shouldBegin] + 1309
7 UIKit 0x008b1d89 -[UIGestureRecognizer setState:] + 171
8 UIKit 0x008e39d7 -[UIPanGestureRecognizer touchesMoved:withEvent:] + 142
9 UIKit 0x0099792a -[UIScrollViewPanGestureRecognizer touchesMoved:withEvent:] + 89
10 UIKit 0x005597d8 -[UIWindow _sendGesturesForEvent:] + 649
11 UIKit 0x0055a971 -[UIWindow sendEvent:] + 1021
12 UIKit 0x0052c5f2 -[UIApplication sendEvent:] + 242
13 UIKit 0x00516353 _UIApplicationHandleEventQueue + 11455
14 CoreFoundation 0x01a6277f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
15 CoreFoundation 0x01a6210b __CFRunLoopDoSources0 + 235
16 CoreFoundation 0x01a7f1ae __CFRunLoopRun + 910
17 CoreFoundation 0x01a7e9d3 CFRunLoopRunSpecific + 467
18 CoreFoundation 0x01a7e7eb CFRunLoopRunInMode + 123
19 GraphicsServices 0x03dba5ee GSEventRunModal + 192
20 GraphicsServices 0x03dba42b GSEventRun + 104
21 UIKit 0x00518f9b UIApplicationMain + 1225
22 Event Receiver 0x000056cd main + 141
23 libdyld.dylib 0x026a5701 start + 1
)
by applying some coloring to the cell, i saw that when i swipe the cell from the accessory view app crashes
a work around is to set the accessoryType to UITableViewCellAccessoryNone in tableView:cellForRowAtIndexPath:
cell.accessoryType = UITableViewCellAccessoryNone;
Refs:
-How To Make A Swipeable Table View Cell With Actions – Without Going Nuts With Scroll Views here
-A Closer Look at Table View Cells here
Hey ~ I've just solved this bug by removing the codes below in my custom UItableview Cell, but I don't know if it may help you
self.contentView.userInteractionEnabled = NO;
In my case, disable the userinteractionEnabled for cell content view will cause exactly the same crash when I trying to swipe left or right in a custom UItableView in iOS7,
and it shall be fixed by removing it
Considering the error you're getting and these lines:
0x01ac90ee _CF_forwarding_prep_0 + 14
0x00785f7a -[UITableViewCellScrollView gestureRecognizerShouldBegin:] + 203
it appears that you've somehow set an instance of UITableViewCellScrollView as the delegate of a gesture recognizer. Since UITableViewCellScrollView probably doesn't implement the UIGestureRecognizerDelegate protocol, you eventually get an unrecognized selector exception.
Examine the gesture recognizer in each of your table cells closely and check the identity of their delegates.
I was messing with my storyboard with no code involved and got this error after I connected "Terms of use" button to a view controller. It was working fine before this action.
-I created and connected a class to Terms of Use View Controller
-I used action push segue to connect
2014-01-22 17:26:45.434 Project[1162:a0b] -[AboutViewController termsOfUseButton:]: unrecognized selector sent to instance 0x8c89d40
2014-01-22 17:26:45.437 Project[1162:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AboutViewController termsOfUseButton:]: unrecognized selector sent to instance 0x8c89d40'
*** First throw call stack:
(
0 CoreFoundation 0x0173b5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014be8b6 objc_exception_throw + 44
2 CoreFoundation 0x017d8903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0172b90b ___forwarding___ + 1019
4 CoreFoundation 0x0172b4ee _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x014d0874 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x0022e0c2 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x0022e04e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x003260c1 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x00326484 -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x00325733 -[UIControl touchesEnded:withEvent:] + 641
11 UIKit 0x0026b51d -[UIWindow _sendTouchesForEvent:] + 852
12 UIKit 0x0026c184 -[UIWindow sendEvent:] + 1232
13 UIKit 0x0023fe86 -[UIApplication sendEvent:] + 242
14 UIKit 0x0022a18f _UIApplicationHandleEventQueue + 11421
15 CoreFoundation 0x016c483f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x016c41cb __CFRunLoopDoSources0 + 235
17 CoreFoundation 0x016e129e __CFRunLoopRun + 910
18 CoreFoundation 0x016e0ac3 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x016e08db CFRunLoopRunInMode + 123
20 GraphicsServices 0x036909e2 GSEventRunModal + 192
21 GraphicsServices 0x03690809 GSEventRun + 104
22 UIKit 0x0022cd3b UIApplicationMain + 1225
23 Project 0x00003a9d main + 141
24 libdyld.dylib 0x01d77725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
(Lame but I found the solution after I finished writing the question)
The reason for this error is I created an IBAction-UIButton method on touch up inside.
I deleted that code and hoped the traces were deleted.
It seems it wasnt, I had to unconnect the touch up inside by clicking the X in red squared spot.
I would try recreating the button and the segue, maybe you changed the IBOutlet name by accident or any other thing.
GL HF