I have 3 methods in which i want that all complete execution one by one.
It probably be done using blocks but i cant learn how to create own blocks. Or Is there any other way to achieve this?
I have scenario as,
Also same scenario without blocks & all is running fine in ios6 but os lower than that is not working
[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
}
As far as I know blocks are asynchronous.So in that case
Call this [self expandrows]; after when you finish your second method call which is call in
get index method.