iOS-NBUImagePicker icon indicating copy to clipboard operation
iOS-NBUImagePicker copied to clipboard

NBUAssetsGroupViewController.gridView infinite loop in layoutSubviews

Open callbacknull opened this issue 10 years ago • 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.

callbacknull avatar Sep 30 '14 23:09 callbacknull

Does it happen in the Demo project?

rivera-ernesto avatar Oct 01 '14 02:10 rivera-ernesto

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.

callbacknull avatar Oct 01 '14 03:10 callbacknull

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.

rivera-ernesto avatar Oct 01 '14 04:10 rivera-ernesto

Well, so that part of the demo has been broken

Is the loop or the demo broken?

rivera-ernesto avatar Oct 01 '14 04:10 rivera-ernesto

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.

callbacknull avatar Oct 01 '14 05:10 callbacknull

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

I will check the Demo. Thanks.

rivera-ernesto avatar Oct 01 '14 05:10 rivera-ernesto