.net - RedLaser 示例应用程序 (MonoTouch) 在加载 BarcodePickerController 时无一异常(exception)地关闭

标签 .net ios xamarin.ios monodevelop

我正在开发一个应用程序,我需要在 ios 应用程序中扫描一些条形码。我被要求在我的 monotouch 应用程序中使用 RedLaser 库。

经过一些调整后,我能够在我的机器上编译、构建和运行该应用程序。

但是,一旦我在主屏幕上单击“扫描”按钮,应用程序就会崩溃。我在 MonoDevelop 的应用程序输出面板上看不到任何异常、错误或警告。我也找不到任何日志。该应用程序正在 iOSSimulator 上运行。

当 OverrlayController 尝试加载 ParentPicker 时会发生此问题。即使只是检查它的值也会使应用程序崩溃。

我已经在它崩溃的地方放了一个代码示例。我发现二维码有问题 here ,所以我禁用了 QRScanning。但仍然是同样的崩溃。 我正在使用

单点触控 6.0, 单开发 3.0.5, 红色激光 3.4.0

如有任何帮助,我们将不胜感激。

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

我已经更新了问题以包含崩溃日志(感谢 Rolf B. 指出我在哪里可以找到它)。但是,它对我来说仍然没有任何意义,因为我不熟悉 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

最佳答案

这原来是绑定(bind)中的错误(它没有为子类化做好准备)。

此问题现已修复,更新后的绑定(bind)可在 http://github.com/mono/monotouch-bindings 获得。

关于.net - RedLaser 示例应用程序 (MonoTouch) 在加载 BarcodePickerController 时无一异常(exception)地关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14209071/

相关文章:

c# - 我应该将Power Collection的OrderedMultiDictionary用作优先级队列吗?

.net - .net 中的隐藏马尔可夫模型实现?

ios - Xcode为什么说“未声明UTF8Encoding”?

当我构建并运行应用程序时,iPhone 模拟器屏幕是黑色的

c# - : UITableView and keyboard scrolling issue 的 Xamarin 解决方案

iphone - UIButton 的响应时间

.net - 有没有办法扩展 ASP.NET Membership Provider?

c# - 如何使用简单注入(inject)器模拟模块/安装程序/注册表

ios - SIGABRT 转换为 UIImage

iphone - 与界面生成器和模拟器相比,为什么 UILabel 换行符在设备上的不同位置?