Re: Collection Views Breaking
Re: Collection Views Breaking
- Subject: Re: Collection Views Breaking
- From: Luther Baker <email@hidden>
- Date: Wed, 20 May 2015 12:39:55 -0500
Thanks Alex,
I have set an exception breakpoint but it never fires - and I will
experiment with popping the second view controller programmatically and
scrolling up.
I think this has to do with my elementary understanding of how
UICollectionViews are reused in this type of transition animation - I've
learned, for instance, that the datasource isn't actually changing (as part
of "useLayoutToLayoutNavigationTransitions").
A tangental point I'm better understanding is that this property really
just causes collection view controller push transitions to use the 'pushed'
controller's layout ... (ie: the datasource is ignored).
For example, tapping on a particular picture in a grid and pushing a new
collection view controller on the stack might not actually change the
existing picture data but does potentially reflow the layout - like, could
make the selected picture huge. Yes, I am thinking that is probably the
purpose of setting this particular property.
Thanks again for looking and replying!
-Luther
On Wed, May 20, 2015 at 11:42 AM, Alex Zavatone <email@hidden> wrote:
> What if you issue the back programatically and then scroll up?
>
> It would be interesting to see just what gets unwired here.
>
> Have you set an exception breakpoint to tell you exactly what is breaking?
>
> On May 20, 2015, at 12:46 AM, Luther Baker wrote:
>
> > I've got a simple iOS project consisting of 2 collection view controllers
> > and a navigation controller.
> >
> > Tapping any item in the first collection view simply pushes the second
> > collection view on the stack.
> >
> > Problem is, when I tap "< Back" and then manually scroll up ... the app
> > crashes with a EXC_BAD_ACCESS error in main.
> >
> > Nothing is logged ... and the stack in the thread looks something like
> >
> > 0 objc_msgSend
> > 16 UIApplicationMain
> > 17 main
> > 18 start
> > 19 start
> >
> > with 17 main highlighted.
> >
> > /////
> >
> > In the code, FirstViewController and SecondViewController are almost
> > identical save for one line. I am specifically looking at what line 24 in
> > SecondViewController does to the push transition.
> >
> > self.useLayoutToLayoutNavigationTransitions = YES;
> >
> > Upon running, the collection view "push" animation looks fine - and the
> "<
> > Back" button actually works ... but once I get back to
> FirstViewController,
> > the original colors never come back. In addition, when I scroll up, I get
> > the error listed above.
> >
> > I've thrown together a small project to demonstrate:
> > https://github.com/LutherBaker/CollectionViewDemo
> >
> > Thoughts? It feels like I'm not referencing something I should be ...
> >
> > Thanks,
> > -Luther
> >
> > PS: I think you may ignore this but note that when you initially select
> an
> > item in the FirstViewController and "push" - the console spits lots and
> > lots of
> >
> > *Snapshotting a view that has not been rendered results in an empty
> > snapshot. Ensure your view has been rendered at least once before
> > snapshotting or snapshot after screen updates.*
> > which I assume is simply a bug or non-relevant logging accidentally left
> in
> > the framework.
> > _______________________________________________
> >
> > Cocoa-dev mailing list (email@hidden)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden