On Aug 15, 2013, at 9:49 AM, Jens Alfke wrote:
> On Aug 15, 2013, at 5:41 AM, Vlad Alekseev wrote:
>
>> dispatch_block_t block = ^{
>> printf("finished");
>> };
>>
>> UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout
>> *)self.collectionView.collectionViewLayout;
>> [self.coll
> As I said before, this is a bug in your code. ‘block’ needs to be copied
> since it is going to be called after the calling function returns.
I work under ARC. It goes to heap automatically.
Also, there are some circumstances that proves your wrong guess:
1. If I copy it manually, it still g
On Aug 15, 2013, at 5:41 AM, Vlad Alekseev wrote:
> dispatch_block_t block = ^{
>printf("finished");
> };
>
> UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout
> *)self.collectionView.collectionViewLayout;
> [self.collectionView performBatchUpdates:^{
>layout.minimumInte
Turns out, this is a bug in UICollectionView or even ARC. And it is easily
reproducible. You can download Apple's sample code:
http://developer.apple.com/library/ios/samplecode/CollectionView-Simple/Introduction/Intro.html
and modify it to return 0 items to the collection view. Then try to perfo
The collection view will very likely have corresponding ivars for the animation
block and its completion handler. If that's the case, it should (shall) create
a copy of the anonymous animation (updates) and completion block when receiving
them in `performBatchUpdate:completion:`.
Now, `finish`
Hey,
ARC should drive this for me. If it wouldn’t, then it wouldn’t work in case if
there are items in the collection view.
Tried to copy manually - no results. BTW, not only «finish», but also
«completion» gets NULLified at the last step.
Vlad.
15 авг. 2013 г., в 9:22, Jens Alfke написал(а):
Sounds like you forgot to copy the block — if it’s being invoked after the
calling function returns (as a completion handler would) it needs to be copied
so it can survive the loss of its original stack frame.
—Jens
___
Cocoa-dev mailing list (Cocoa-d
Hey!
I have a method where I update my collection view's layout parameter and want
to have a completion block invoked when animation completes:
- (void)transitionAnimated:(BOOL)animated
completion:(dispatch_block_t)completion
{
dispatch_block_t updates = ^{
self.layout.maximumScale