iPhone enumerateGroupsWithTypes整理选择器 [英] iPhone enumerateGroupsWithTypes finishing selector

查看:54
本文介绍了iPhone enumerateGroupsWithTypes整理选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

[assetsLibrary enumerateGroupsWithTypes:groupTypes usingBlock:listGroupBlock failureBlock:failureBlock];

枚举相册.

枚举器以异步"方式运行,换句话说,方法在枚举所有项之前返回.

The enumerator is acting in an "asynchronous" way, in other words the methods returns before enumerating all items.

我怎么知道枚举何时完成?

How can I know when the enumeration is finished?

我正在使用组填充NSMutableArray,并在枚举完成后调用 [myTableView reloadData] .

I'm populating a NSMutableArray with the groups, and would to call [myTableView reloadData] after enumeration is finished.

推荐答案

您的枚举将为您的块提供nil-pointer组,并在其最后经过时将stop设置为true.您可以使用它来设置标志,也可以在下次通过RunLoop时使用performSelectorOnMainThread:调用一些整理代码.

Your enumeration will give your block a nil-pointer group and set stop to true when it goes through its last pass. You can use this to set a flag or call some finishing code using performSelectorOnMainThread: on the next pass through the RunLoop.

这篇关于iPhone enumerateGroupsWithTypes整理选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆