xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.78k stars 1.33k forks source link

Crash when touching an image cell #209

Closed besi closed 8 years ago

besi commented 8 years ago

I have a fairly simple form that contains some text inputs and an image.

form +++=
    TextRow("title"){
        $0.title = "Title"
        $0.value = self.product?.title
    }
    <<< TextRow("code"){
        $0.title = "Code"
        $0.value = self.product?.code
    }
    <<< ImageRow("image"){
        $0.title = "Image"

        if let imageData = self.product?.image{
            $0.value = UIImage(data:imageData)
        }
    }

Now when I click the image cell I'll get the following crash:

2016-01-25 19:11:35.168 ShopInventory[10496:5374488] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.

2016-01-25 18:48:29.240 MyApp[8623:5220884] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x7c194400>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem.  If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00ba9a14 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0285ae02 objc_exception_throw + 50
    2   UIKit                               0x01e78088 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3956
    3   UIKit                               0x01526e9f __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2326
    4   UIKit                               0x015246b0 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 333
    5   UIKit                               0x01567577 __40+[UIViewController _scheduleTransition:]_block_invoke + 18
    6   UIKit                               0x0139830f _runAfterCACommitDeferredBlocks + 337
    7   UIKit                               0x013ade19 _cleanUpAfterCAFlushAndRunDeferredBlocks + 103
    8   UIKit                               0x013bbd9b _afterCACommitHandler + 102
    9   CoreFoundation                      0x00ac2ffe __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    10  CoreFoundation                      0x00ac2f5e __CFRunLoopDoObservers + 398
    11  CoreFoundation                      0x00ab88dc __CFRunLoopRun + 1340
    12  CoreFoundation                      0x00ab80e6 CFRunLoopRunSpecific + 470
    13  CoreFoundation                      0x00ab7efb CFRunLoopRunInMode + 123
    14  GraphicsServices                    0x078c7664 GSEventRunModal + 192
    15  GraphicsServices                    0x078c74a1 GSEventRun + 104
    16  UIKit                               0x0138abfa UIApplicationMain + 160
    17  MyApp                       0x000b3dac main + 140
    18  libdyld.dylib                       0x04007a21 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

This might be related to #141

besi commented 8 years ago

Update: Even when I set $0.disabled = true I can still touch the image and produce the error.

I would expect that disabling the cell would prevent opening any popovers or the like.

mtnbarreto commented 8 years ago

@besi Were you running your app on an iPad?

besi commented 8 years ago

Yes I run it on both the iPad and the iPhone.