草庐IT

performbatchupdates

全部标签

ios - performBatchUpdates 崩溃的噩梦

我在performBatchUpdates期间面临崩溃的噩梦在collectionview上.问题基本上是这样的:我在服务器的目录中有很多图像。我想在collectionview上显示这些文件的缩略图.但缩略图必须从服务器异步下载。当它们到达时,它们将使用如下方式插入到CollectionView中:dispatch_async(dispatch_get_main_queue(),^{[self.collectionViewperformBatchUpdates:^{if(removedIndexes&&[removedIndexescount]>0){[self.collection

ios - 为什么在 performBatchUpdates 中对父 UIViewController 的强引用会泄漏事件?

我刚刚调试完一个非常讨厌的UIViewController漏洞,这样即使在调用dismissViewControllerAnimated之后UIViewController也没有被释放。我将问题追查到以下代码块:self.dataSource.doNotAllowUpdates=YES;[self.collectionViewperformBatchUpdates:^{[self.collectionViewreloadItemsAtIndexPaths:@[indexPath]];}completion:^(BOOLfinished){self.dataSource.doNotAll

ios - 为什么在 performBatchUpdates 中对父 UIViewController 的强引用会泄漏事件?

我刚刚调试完一个非常讨厌的UIViewController漏洞,这样即使在调用dismissViewControllerAnimated之后UIViewController也没有被释放。我将问题追查到以下代码块:self.dataSource.doNotAllowUpdates=YES;[self.collectionViewperformBatchUpdates:^{[self.collectionViewreloadItemsAtIndexPaths:@[indexPath]];}completion:^(BOOLfinished){self.dataSource.doNotAll

ios - UITableView "beginUpdates"和 UICollectionView "performBatchUpdates"是否具有相同的行为?

我在浏览文档时开始怀疑UITableView中的“beginUpdates”和UICollectionView中的“performBatchUpdates”是否具有相同的行为。如果是这样,是否有理由将它们称为不同的,即使它们实际上是相同的东西?谢谢! 最佳答案 UITableView的beginUpdates必须与对endUpdates的调用匹配。UICollectionView的performBatchUpdates:completion方法不需要您在进行更新时回调到CollectionView,大概是因为您传入的工作block更

ios - UITableView "beginUpdates"和 UICollectionView "performBatchUpdates"是否具有相同的行为?

我在浏览文档时开始怀疑UITableView中的“beginUpdates”和UICollectionView中的“performBatchUpdates”是否具有相同的行为。如果是这样,是否有理由将它们称为不同的,即使它们实际上是相同的东西?谢谢! 最佳答案 UITableView的beginUpdates必须与对endUpdates的调用匹配。UICollectionView的performBatchUpdates:completion方法不需要您在进行更新时回调到CollectionView,大概是因为您传入的工作block更

objective-c - UICollectionView 使用 performBatchUpdates 执行更新

我有一个UICollectionView,我正在尝试动态/使用动画将项目插入其中。所以我有一些异步下载图像的功能,并且想批量插入项目。获得数据后,我想执行以下操作:[self.collectionViewperformBatchUpdates:^{for(UIImage*imageinimages){[self.collectionViewinsertItemsAtIndexPaths:****]}}completion:nil];现在代替***,我应该传递一个NSIndexPaths数组,它应该指向要插入的新项目的位置。我很困惑,因为在提供位置后,我如何提供应该显示在该位置的实际图像

objective-c - UICollectionView 使用 performBatchUpdates 执行更新

我有一个UICollectionView,我正在尝试动态/使用动画将项目插入其中。所以我有一些异步下载图像的功能,并且想批量插入项目。获得数据后,我想执行以下操作:[self.collectionViewperformBatchUpdates:^{for(UIImage*imageinimages){[self.collectionViewinsertItemsAtIndexPaths:****]}}completion:nil];现在代替***,我应该传递一个NSIndexPaths数组,它应该指向要插入的新项目的位置。我很困惑,因为在提供位置后,我如何提供应该显示在该位置的实际图像

ios - Swift 2 - performBatchUpdates - 当在 UICollectionView 框架内可见时,一个一个地动画单元格

我正在尝试为框架中可见的UICollectionView的每个单元格制作动画。每次我滚动时,都会出现一个新的单元格和动画。我在cellForItemAtIndexPath中使用performBatchUpdates执行此操作,但是,动画会同时应用于所有单元格,而且速度非常快。好像没识别到1秒的动画。我还试图找到在按下按钮但没有成功时将动画应用于单元格的方法。我使用的代码是:overridefunccollectionView(collectionView:UICollectionView,cellForItemAtIndexPathindexPath:NSIndexPath)->UIC

ios - UITableView 使用 beginUpdates()/endUpdates()/performBatchUpdates() 意外反弹

我这里有一个非常简单的UITableViewController/NSFetchedResultsController案例。它来自XcodeMaster-DetailApp示例代码,所以很容易重现。我有一个CoreData模型,其中包含1个实体和1个字符串属性。它显示在UITableViewController中。我使用.subtitle系统单元格类型。通过选择一行,我只需更新字符串属性。所以我的问题是,当我添加足够多的行供tableview滚动时(在带有导航栏的iPhone5s上为10-11行),然后我向下滚动并选择任何行,tableview会上下弹跳。如果行数较少(少于10行)或行

ios - viewDidDisppear 导致错误后的 performBatchUpdates?

我在打电话performBatchUpdates({self.insertItemsAtIndexPaths(indexPathes)},completion:{_in})在Controller中不可见的CollectionView上!已经有另一个ViewController推到它上面。这会导致以下错误:Invalidupdate:invalidnumberofitemsinsection0.Thenumberofitemscontainedinanexistingsectionaftertheupdate(12)mustbeequaltothenumberofitemscontain