Issue Description
When creating an Appcelerator module the first XIB file was loaded. However, no tap/gesture were detected and we are unable to move/navigate to the next XIB file.
Steps to reproduce
1) iOS native project which has 2 XIB files. On clicking "Button" you will move to the next XIB page with text "Label"
2) Grab Appcelerator module
3) Test Project with first page from Appcelerator view having text "load XIB". On click it will load the first page of native XIB. On clicking "Button" it crashes. See please logs below.
Stack Trace
-- Start simulator log -------------------------------------------------------
[INFO] Application started
[INFO] XibSampleProject/1.0 (5.1.1.e46100b)
[INFO] [object ComAccentureXibmodModule] loaded
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] Reason:
[ERROR] -[UIViewController buttonTapped:]: unrecognized selector sent to instance 0x7fb962c55320
[ERROR] Stack trace:
[ERROR]
[ERROR] 0 CoreFoundation 0x000000010fa4fe4d __exceptionPreprocess + 141
[ERROR] 1 libobjc.A.dylib 0x000000010f421deb objc_exception_throw + 48
[ERROR] 2 CoreFoundation 0x000000010fa5848d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
[ERROR] 3 CoreFoundation 0x000000010f9a590a ___forwarding___ + 970
[ERROR] 4 CoreFoundation 0x000000010f9a54b8 _CF_forwarding_prep_0 + 120
[ERROR] 5 UIKit 0x000000010bf47194 -[UIApplication sendAction:to:from:forEvent:] + 92
[ERROR] 6 UIKit 0x000000010c0b66fc -[UIControl sendAction:to:forEvent:] + 67
[ERROR] 7 UIKit 0x000000010c0b69c8 -[UIControl _sendActionsForEvents:withEvent:] + 311
[ERROR] 8 UIKit 0x000000010c0b5af8 -[UIControl touchesEnded:withEvent:] + 601
[ERROR] 9 UIKit 0x000000010bfb649b -[UIWindow _sendTouchesForEvent:] + 835
[ERROR] 10 UIKit 0x000000010bfb71d0 -[UIWindow sendEvent:] + 865
[ERROR] 11 UIKit 0x000000010bf65b66 -[UIApplication sendEvent:] + 263
[ERROR] 12 UIKit 0x000000010bf3fd97 _UIApplicationHandleEventQueue + 6844
[ERROR] 13 CoreFoundation 0x000000010f97ba31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
[ERROR] 14 CoreFoundation 0x000000010f97195c __CFRunLoopDoSources0 + 556
[ERROR] 15 CoreFoundation 0x000000010f970e13 __CFRunLoopRun + 867
[ERROR] 16 CoreFoundation 0x000000010f970828 CFRunLoopRunSpecific + 488
[ERROR] 17 GraphicsServices 0x0000000110d97ad2 GSEventRunModal + 161
[ERROR] 18 UIKit 0x000000010bf45610 UIApplicationMain + 171
[ERROR] 19 XibSampleProject 0x000000010a0413e6 main + 310
[ERROR] 20 libdyld.dylib 0x000000011069d92d start + 1
[ERROR]
[ERROR] 2016-01-25 12:24:51.130 XibSampleProject[42557:4180970] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController buttonTapped:]: unrecognized selector sent to instance 0x7fb962c55320'
[ERROR] *** First throw call stack:
[ERROR] (
[ERROR] 0 CoreFoundation 0x000000010fa4fe65 __exceptionPreprocess + 165
[ERROR] 1 libobjc.A.dylib 0x000000010f421deb objc_exception_throw + 48
[ERROR] 2 CoreFoundation 0x000000010fa5848d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
[ERROR] 3 CoreFoundation 0x000000010f9a590a ___forwarding___ + 970
[ERROR] 4 CoreFoundation 0x000000010f9a54b8 _CF_forwarding_prep_0 + 120
[ERROR] 5 UIKit 0x000000010bf47194 -[UIApplication sendAction:to:from:forEvent:] + 92
[ERROR] 6 UIKit 0x000000010c0b66fc -[UIControl sendAction:to:forEvent:] + 67
[ERROR] 7 UIKit 0x000000010c0b69c8 -[UIControl _sendActionsForEvents:withEvent:] + 311
[ERROR] 8 UIKit 0x000000010c0b5af8 -[UIControl touchesEnded:withEvent:] + 601
[ERROR] 9 UIKit 0x000000010bfb649b -[UIWindow _sendTouchesForEvent:] + 835
[ERROR] 10 UIKit 0x000000010bfb71d0 -[UIWindow sendEvent:] + 865
[ERROR] 11 UIKit 0x000000010bf65b66 -[UIApplication sendEvent:] + 263
[ERROR] 12 UIKit 0x000000010bf3fd97 _UIApplicationHandleEventQueue + 6844
[ERROR] 13 CoreFoundation 0x000000010f97ba31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
[ERROR] 14 CoreFoundation 0x000000010f97195c __CFRunLoopDoSources0 + 556
[ERROR] 15 CoreFoundation 0x000000010f970e13 __CFRunLoopRun + 867
[ERROR] 16 CoreFoundation 0x000000010f970828 CFRunLoopRunSpecific + 488
[ERROR] 17 GraphicsServices 0x0000000110d97ad2 GSEventRunModal + 161
[ERROR] 18 UIKit 0x000000010bf45610 UIApplicationMain + 171
[ERROR] 19 XibSampleProject 0x000000010a0413e6 main + 310
[ERROR] 20 libdyld.dylib 0x000000011069d92d start + 1
[ERROR] )
[ERROR] libc++abi.dylib: terminating with uncaught exception of type NSException
https://wiki.appcelerator.org/display/guides2/Module+Development+Tutorial+-+iOS See section about xib.
Hi, just curious, are you trying to create https://github.com/appcelerator-modules/ti.gigya
@Chee, nope we are not trying to create ti.gigya module. We just used that project as a reference, as mentioned in your earlier comment. What we are trying to achieve is handling the click events of buttons/views which are created in xib and have their event listener in their respective .h/.m file (within the module).
According to the crash log, you're trying to call
- (IBAction)buttonTapped:(UIButton *)sender
of a _UIViewController_, which it does not exists. Which means that you created a normal _UIViewController_ instead of the _RootViewController_. What I can see, from looking at the code and content of the XIB, is that you're creating a _UIViewController_ passing XIB file that does not contain a ViewController. It simply contains a _UIView_ (with subviews and so on)XIB files can be loaded using Hyperloop these days. Example:
Thx!
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.