[self AAAA:^(BOOL isSuccessed, id userInfo, NSString *errorMsg) {
NSLog(@"AAAA: %d, userInfo: %@ errorMsg: %@", isSuccessed, userInfo, errorMsg);
}];
-(void)AAAA:(void(^)(BOOL isSuccessed,id userInfo,NSString *errorMsg))callback
{
__block NSMutableDictionary *_info = [@{} mutableCopy];
[self a001:
^(BOOL isSuccessed, id userInfo, NSString *errorMsg) {
NSLog(@"a001");
if (isSuccessed) {
[_info setObject:userInfo forKey:@"001info"];
}
else
{
[_info setObject:errorMsg forKey:@"001info"];
}
[self a002:^(BOOL isSuccessed, id userInfo, NSString *errorMsg) {
NSLog(@"a002");
if (isSuccessed) {
[_info setObject:userInfo forKey:@"002info"];
}
else
{
[_info setObject:errorMsg forKey:@"002info"];
}
[self a003:^(BOOL isSuccessed, id userInfo, NSString *errorMsg) {
NSLog(@"a003");
if (isSuccessed) {
[_info setObject:userInfo forKey:@"003info"];
}
else
{
[_info setObject:errorMsg forKey:@"003info"];
}
if (callback) {
callback(YES,@"userInfo", @"errorMsg");
}
}];
}];
}];
}
-(void)a001:(void(^)(BOOL isSuccessed,id userInfo,NSString *errorMsg))callback
{
NSLog(@"a001 inner");
if (callback) {
callback(YES,@"userInfo", @"errorMsg");
}
}
-(void)a002:(void(^)(BOOL isSuccessed,id userInfo,NSString *errorMsg))callback
{
NSLog(@"a002 inner");
if (callback) {
callback(YES,@"userInfo", @"errorMsg");
}
}
-(void)a003:(void(^)(BOOL isSuccessed,id userInfo,NSString *errorMsg))callback
{
NSLog(@"a003 inner");
if (callback) {
callback(NO,@"userInfo", @"errorMsg");
}
}