在块目标c内调用块

时间:2015-04-09 16:57:59

标签: objective-c objective-c-blocks

我希望在完成A座时调用B座(isInsertSuccess返回YES)。有人可以帮我使用下面的代码吗?谢谢。

A座

[userServiceInstance insertDataOnSuccess:^
 {
    if (![userServiceInstance isInsertSuccess]) {
                 NSLog(@“Insert is successful”);
    }
 }];

B座

[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
    NSLog(@“This is the status, %ld”, status);
}];

1 个答案:

答案 0 :(得分:0)

你可以这样做:

[userServiceInstance insertDataOnSuccess:^{
   if (![userServiceInstance isInsertSuccess]) {
       NSLog(@“Insert is successful”);
       [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
           NSLog(@“This is the status, %ld”, status);
       }];
   }
}];