0

我有以下代码:

- (void) likeImage:(AHInstagramImageData *) image
            success:(void (^)(BOOL success))success
           failure:(void (^)(NSError* error, NSInteger statusCode))failure
{
    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                            [AHInstagramSession session].accessToken, @"access_token",
                            nil];
    NSString *likeCommentPath = [NSString stringWithFormat:@"media/%@/likes", image.imageId];
    [self postPath:likeCommentPath parameters:params success:^(AFHTTPRequestOperation *operation, id response){
        if ([operation hasAcceptableStatusCode]) {
            [[LocalyticsSession sharedLocalyticsSession] tagEvent:@"Like"];

            [[AHFacebookSession session] postAction:@"like" forImageData:image];
            [[AHTwitterSession session] postAction:@"like" andObject:image];

            success(YES);


    }failure:^(AFHTTPRequestOperation *operation, NSError *error){
         failure(error, operation.response.statusCode);
         NSLog(@"Failure on liking a photo %@", [error description]);
    }];
}

它给了我错误:

在此处输入图像描述

4

1 回答 1

1

Doesn't look like a memory problem. Check success block if it was actually set before you invoke it.

if (success)
{
    success(YES);
}
于 2012-10-19T01:18:06.957 回答