ca-archived/iOS-NBUImagePicker

NBUAssetsGroupViewController.gridView infinite loop in layoutSubviews

Opened this issue · 6 comments

So, I had a NBUAssetsGroupViewController set up properly and definitely works in iOS 7. However, with the iOS 8 release it seems that the ObjectGridView is getting stuck in an infinite loop on the layoutSubviews method.

Does it happen in the Demo project?

Well, so that part of the demo has been broken - at least as long as I started using NBUImagePicker. Though not much was needed to get it to work - had to enable the tabbar item, create the missing xib file.

So I guess something with how I use it then. How I set things up was a created a 'Camera' storyboard (I use Storyboard links - RBStoryboardLink) with all my different parts connected by segue. So in there I have inherited versions of the NBUCameraVC, NBUAssetsLibraryVC, NBUAssetsGroupVC, and NBUCropVC.

I added the following in viewDidLoad to trigger the segue between the LibraryVC and the GroupVC.

self.groupSelectedBlock = ^(NBUAssetsGroup *group) {
        @strongify(self);
        [self performSegueWithIdentifier:@"GroupSegue" sender:group];
    };

And in the prepareForSegue: I set my GroupVC's assetsGroup property. Right at the beginning of the transition something throws it off into the infinite loop.

I tried debugging it a bit but I hadn't poked around the library too much before. I think my head hurts now from the like what - 5 levels of inheritance in some places? :P

Anyways, it's not too big of a deal for me anymore. I needed to find a solution asap so I ended up replacing that part of the app with the FPPicker library.

It would be good to set a break point wherever it loops, let it loop a couple of times and take a screenshot of the stack at the breakpoint. Then we can see what are the sequence of calls that take part of the infinite loop.

Well, so that part of the demo has been broken

Is the loop or the demo broken?

Ahh yeah that'd be something to try.

Although, on another note, you're planning removing iOS 5 support from NBUKit, right? Soooo then ObjectGridView can probably gonna get updated to a collection view then, eh? :D

It's the demo that's broken - loop unrelated. I had it working and no loop bug.

Yes, getting rid of all non NBU-prefixed classes soon.

I will check the Demo. Thanks.