dji-sdk / Mobile-UXSDK-iOS

DJI Mobile UXSDK is a suite of product agnostic UI objects that fast tracks the development of iOS applications using the DJI Mobile SDK.
Other
72 stars 40 forks source link

Removing widgets from the status bar crashes the app with an NSRangeException #15

Open fontained opened 7 years ago

fontained commented 7 years ago

When we remove widgets from the status bar like this ` if let batteryWidget = self.statusViewController?.widget(with: DULBatteryWidget.self) { self.statusViewController?.removeWidget(batteryWidget) }

    if let visionWidget = self.statusViewController?.widget(with: DULVisionWidget.self) {
        self.statusViewController?.removeWidget(visionWidget)
    }

    if let connectionWidget = self.statusViewController?.widget(with: DULConnectionWidget.self) {
        self.statusViewController?.removeWidget(connectionWidget)
    }

the app crashes sometimes at startup with the following exception: Fatal Exception: NSRangeException 0 CoreFoundation 0x182aa7d38 __exceptionPreprocess 1 libobjc.A.dylib 0x181fbc528 objc_exception_throw 2 CoreFoundation 0x182aa7c80 -[NSException initWithCoder:] 3 Foundation 0x1833986e4 -[NSRLEArray objectAtIndex:effectiveRange:] 4 Foundation 0x1833b4288 -[NSConcreteMutableAttributedString addAttribute:value:range:] 5 DJIUILibrary 0x103c53284 (Missing) 6 DJIUILibrary 0x103c53098 (Missing) 7 DJISDK 0x103304008 (Missing) 8 libdispatch.dylib 0x18242d088 _dispatch_call_block_and_release 9 libdispatch.dylib 0x18242d048 _dispatch_client_callout 10 libdispatch.dylib 0x182439b74 _dispatch_main_queue_callback_4CF$VARIANT$mp 11 CoreFoundation 0x182a4ff20 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 12 CoreFoundation 0x182a4dafc __CFRunLoopRun 13 CoreFoundation 0x18296e2d8 CFRunLoopRunSpecific 14 GraphicsServices 0x1847fff84 GSEventRunModal 15 UIKit 0x18bf1a880 UIApplicationMain 16 QualiticsInspector 0x102e6553c main (AppDelegate.swift:16) 17 libdyld.dylib 0x18249256c start ` Could you please have a look on this issue and provide us a fix for it?

IOS 11 XCode 9 Ipad. SDK-IOS: 4.3.1 IOS-UILibrary: 4.3

zoemcateedji commented 7 years ago

Thanks for letting us know, we will have a developer look into it.

fontained commented 7 years ago

Hi @zoemcateedji, For your information, I tested it with a LB2 + A3. The crash occurs when the application starts or when you disconnect the USB cable from the remote controller and you plug it again. The crash doesn't occur every time. Regards

fontained commented 7 years ago

Hi @zoemcateedji, do you have some news for me? Regards

zoemcateedji commented 7 years ago

Thanks for the details. We are hoping to look at this in the next week.

fontained commented 7 years ago

Hi @zoemcateedji, do you have some news for me? Regards

fontained commented 6 years ago

Hi @zoemcateedji, did you progress on this issue? Regards

rplumbo commented 6 years ago

Have there been any updates on this? I'm seeing this as well in latest build.