gpt4 book ai didi

iphone - 如何使用 block 一步一步完成方法?

转载 作者:行者123 更新时间:2023-12-01 19:15:06 24 4
gpt4 key购买 nike

我有3种方法,我希望所有这些方法一一完成。

可能使用块完成,但是我无法学习如何创建自己的块。还是有其他方法可以实现这一目标?

我有这样的情况

同样在没有块的情况下,所有情况都在ios6中运行良好,但低于os的操作系统不起作用

[self getIndex];
[self expandrows]; //I want this expandrows to be called only after everything in getIndex is finished.

-(void)getIndex
{
[self didSelectRowAtIndexPath:indexPath];
//Once this didselect is completed execution than after only i want to start this loop
for (int index = 0; index < [tableView numberOfRowsInSection:0]; index++)
{
NSMutableDictionary *aMutDicCur = [self.model itemForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
if([[aMutDicCur valueForKey:@"CategoryId"] intValue] == 4)
{
indexPath = [NSIndexPath indexPathForRow:index inSection:0];
break;
}
}

//After this loop finishes i need to again call one other method
}

据我所知,块是异步的。

最佳答案

称此为[自我扩展行]当您完成第二个方法调用后

获取索引方法。

关于iphone - 如何使用 block 一步一步完成方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13873766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com