I tried using MHGalleryController as per the example except that I present it in a UISplitViewController and not modally. The app crashed at startup on the following line :
After a while I figured out the datasource property on MHGalleryImageViewerViewController was nil, leading to a nilitem and a nilimageViewController.
I explored the details of -[UIViewController(MHGalleryViewController) presentMHGalleryController:animated:completion:]and realized it assigned the controller itself as a datasource if no datasource is set, and replicating this behavior fixed my crash.
I would strongly suggest that this be done by default when setting the items array property of the main controller or when no datasource is set, or at least be explained in the doc to prevent further issues since this seams like a basic use of the component.
Hi,
I tried using
MHGalleryController
as per the example except that I present it in aUISplitViewController
and not modally. The app crashed at startup on the following line :After a while I figured out the
datasource
property onMHGalleryImageViewerViewController
wasnil
, leading to anil
item
and anil
imageViewController
.I explored the details of
-[UIViewController(MHGalleryViewController) presentMHGalleryController:animated:completion:]
and realized it assigned the controller itself as a datasource if no datasource is set, and replicating this behavior fixed my crash.I would strongly suggest that this be done by default when setting the items array property of the main controller or when no datasource is set, or at least be explained in the doc to prevent further issues since this seams like a basic use of the component.
Thanks for considering