guicocoa/photopicker-ios

GCImagePickerController pushes nil view controller

Closed this issue · 2 comments

The following line in CGImagePickerController causes the warning
"Application tried to push a nil view controller on target <CGImagePickerController: 0xxxxxx>"
to be printed on the console.

There's a chicken and egg problem here, in that the root controller needs self as a delegate, but creating self before the root controller gets the annoying warning.

This is true. It turns out that subclassing UINavigationController is tricky. I think that I would be able to just override init and achieve the same effect but the dev docs suggest always overriding the designated initializer. So then the appropriate action would be to only initialize self after the root controller has been initialized but that goes against the convention a bit. Still looking for a clever way to do this.

This issue has been resolved. I switched to a factory method on GCImagePickerController to build the view controllers instead of subclassing UINavigationController. Thanks!