|
有2个View View A是View B的子窗口, View A有个按钮Button A, 单击Button A向View B发送消息,让View B删除View A. 用什么方法发送呢? |
|
|
目前找到一个办法:
- (void)evTouchUpInside:(id)sender {
NSLog(@"before dispathc_async");
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSLog(@"1 dispathc_async");
// 耗时的操作
[NSThread sleepForTimeInterval:3];
dispatch_async(dispatch_get_main_queue(), ^{
// 更新界面
NSLog(@"2 dispathc_async");
});
});
NSLog(@"after dispathc_async");
}
希望能抛砖引玉,, 不知道各位还有什么更好的办法。。。 |
|
35分 |
我想到的一个方法是用通知,然后用dispatch_after
|
|
自己开辟一个子线程 来处理,就是异步了
|
|
|
弱弱的问一下 为什么要用异步? 其实你要做到什么效果我没明白..
|
|
|
⊙﹏⊙b汗。。。 假设有个UITableView, 有若干个UITableViewCell, 每个Cell上面都有一个Button, 单击Cell上面的Button,UITableView可以删除这个Cell….. |
|
5分 |
那你应该把Button的事件让TableView的Controller来处理 |