I am developing an application where I need to scan few barcodes in an ios App. I was asked to used RedLaser library with my monotouch application.
I am able to compile, build, and run the application on my machine after few tweaks.
However once I click on the Scan button from the Home Screen, the application crashes. I cannot see any exception, Errors, or warnings on the Application Output panel on MonoDevelop. I could not find any Log either. The application is running on the iOSSimulator.
The issue happens when the OverrlayController tries to load the ParentPicker. Even just checking its value crashes the application.
I have put a sample of the code where it is crashing. I found that there was an issue with QRCode here, so I disabled QRScanning. but still the same crash.
I am using
Monotouch 6.0,
MonoDevelop 3.0.5,
RedLaser 3.4.0
Any help would be greatly appreciated.
public partial class RLSampleViewController : UIViewController
{
public RLSampleViewController (IntPtr handle) : base (handle) { }
partial void scanPressed (MonoTouch.UIKit.UIBarButtonItem sender)
{
//THIS IS THE LINE WHERE THE APP IS JUST CRASHING
if (overlayController.ParentPicker == null)
{
BarcodePickerController picker = new BarcodePickerController ();
// setup picker
picker.Overlay = overlayController;
picker.Delegate = new BarcodePickerDelegate (this);
// Initialize with portrait mode as default
picker.Orientation = UIImageOrientation.Up;
// The active scanning region size is set in OverlayController.m
}
// The rest of the code was ignored
I have updated the question to include the crash log (Thanks to Rolf B. for pointing me to where to find it). However, it still does not make any sense to me as I do not have familiarity with Objective-C.
> Process: RedLaserSample [10999]
> Path: /Users/USER/Library/Application Support/iPhone
> Simulator/*/RedLaserSample.app/RedLaserSample
> Identifier: RedLaserSample
> Version: ???
> Code Type: X86 (Native)
> Parent Process: launchd [243]
> User ID: 501
> Date/Time: 2013-01-08 16:58:35.532 +1100
> OS Version: Mac OS X 10.8.2 (12C60)
> Report Version: 10
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
> Exception Type: EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bf7ffffc
> VM Regions Near 0xbf7ffffc:
> Stack 00000000b056d000-00000000b057d000 [ 64K] rw-/rwx SM=COW
> --> Stack 00000000bc000000-00000000bf800000 [ 56.0M] ---/rwx SM=NUL
> Stack 00000000bf800000-00000000c0000000 [ 8192K] rw-/rwx SM=COW
> Application Specific Information:
> iPhone Simulator 358.4, iPhone OS 6.0 (iPhone/10A403)
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 CoreFoundation 0x0405f6cd typeStringHash + 13
> 1 CoreFoundation 0x03fffdb0 __CFDictionaryHashKey + 32
> 2 CoreFoundation 0x03fe53e2 CFBasicHashFindBucket + 1426
> 3 CoreFoundation 0x03fe4e2d CFDictionaryGetValue + 109
> 4 CoreFoundation 0x0405e0ea +[NSMethodSignature signatureWithObjCTypes:] + 250
> 5 CoreFoundation 0x040fb5c3 -[NSObject(NSObject) methodSignatureForSelector:] + 83
> 6 RedLaserSample 0x0027a752 monotouch_trampoline + 82
> 7 ??? 0x0c7e9010 0 + 209621008
> 8 ??? 0x12c68efc 0 + 315002620
> 9 ??? 0x12c68fd4 0 + 315002836
> 10 RedLaserSample 0x00077112 mono_jit_runtime_invoke + 722
> 11 RedLaserSample 0x001d8bae mono_runtime_invoke + 126
> 12 RedLaserSample 0x0027b568 monotouch_trampoline + 3688
> 13 ??? 0x0c7e9010 0 + 209621008
> 14 ??? 0x12c68efc 0 + 315002620
> 15 ??? 0x12c68fd4 0 + 315002836
This turned out to be a bug in the binding (it wasn’t prepared for subclassing).
This has now been fixed, and an updated binding is available at http://github.com/mono/monotouch-bindings