Advertisement
Guest User

Recursive Block - Bad Access Exception

a guest
Apr 3rd, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef void (^RetryAPICall)(BOOL isRetry);
  2. - (RetryAPICall) makeRecursiveBlock
  3. {
  4.     RetryAPICall aBlock;
  5.     __block __unsafe_unretained RetryAPICall aBlock_recursive;
  6.     aBlock_recursive = aBlock = [^(BOOL isRetry)
  7.     {
  8.      [AFHTTPClient postPath:path
  9.                  parameters:params
  10.                         success:^(AFHTTPRequestOperationSKZ *operation, id responseObject) {
  11.                 //Execute success flow here  
  12.                     }
  13.                         failure:^(AFHTTPRequestOperationSKZ *operation, NSError *error) {
  14.                 aBlockRecursive(YES); //This throws a bad access exception
  15.                 }];
  16.     } copy];
  17.  
  18.     return aBlock;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement