2014-08-05 22:18:46.455 SwiftUI[1329:40871] -[_TtC7SwiftUI14MViewControler clickMe]: unrecognized selector sent to instance 0x10ea15dc0
2014-08-05 22:18:46.458 SwiftUI[1329:40871] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_TtC7SwiftUI14MViewControler clickMe]: unrecognized selector sent to instance 0x10ea15dc0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000100463995 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101eef9a3 objc_exception_throw + 45
2 CoreFoundation 0x0000000100469e8d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001003c391c ___forwarding___ + 988
4 CoreFoundation 0x00000001003c34b8 _CF_forwarding_prep_0 + 120
5 UIKit 0x0000000100cdd6b6 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x0000000100ddf1c0 -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x0000000100dde58f -[UIControl touchesEnded:withEvent:] + 522
8 UIKit 0x0000000100d223b8 -[UIWindow _sendTouchesForEvent:] + 735
9 UIKit 0x0000000100d22ce3 -[UIWindow sendEvent:] + 683
10 UIKit 0x0000000100cf01a1 -[UIApplication sendEvent:] + 246
11 UIKit 0x0000000100cfd07a _UIApplicationHandleEventFromQueueEvent + 17591
12 UIKit 0x0000000100cd9269 _UIApplicationHandleEventQueue + 1967
13 CoreFoundation 0x0000000100399a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010038f26d __CFRunLoopDoSources0 + 269
15 CoreFoundation 0x000000010038e8a4 __CFRunLoopRun + 868
16 CoreFoundation 0x000000010038e2d6 CFRunLoopRunSpecific + 470
17 GraphicsServices 0x00000001040ccbbc GSEventRunModal + 161
18 UIKit 0x0000000100cdc288 UIApplicationMain + 1282
19 SwiftUI 0x0000000100002b6d top_level_code + 77
20 SwiftUI 0x0000000100002baa main + 42
21 libdyld.dylib 0x0000000102478145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
mButton.addTarget(self, action:"clickMe:", forControlEvents:.TouchUpInside);
原因是冒号没写才导致的错误,望大家细心点。