2016-11-23 91 views
0

我已经通过方法作为块,我的功能是这样的。iOS块成为僵尸

- (void)setPhoneNumber:(NSString *)phoneNo andView:(UIView *)view andSuccessBlock:(void (^)(id responseObject))successBlock andFailureBlock:(void (^)(NSString *errorMsg, NSInteger errorCode, AFHTTPRequestOperation *operation, NSError *error))failureBlock { 

} 

我打电话是这样的。

[[WSHelper sharedInstance] setPhoneNumber:phoneNumber andView:nil andSuccessBlock:^(id responseObject) { 

    } andFailureBlock:^(NSString *errorMsg, NSInteger errorCode, AFHTTPRequestOperation *operation, NSError *error) { 

    }]; 

问题是,当我检查successBlock,它被释放(我正在使用弧,不应该像那样释放)。我试过typedef,也不行。在我的其他项目中,这工作正常,但只在这里,这是不好的。我该如何解决?

(LLDB)PO successBlock
0x00000001078063c0

回答

0

你还没有添加的块中的代码。但我想知道是否有内容引起循环引用。我会尝试分配应用程序,记录打开的所有保留。这将向您显示保留的发生地点,哪些(有点运气)会指出问题所在。

+0

让我检查一下。希望它能解决。 –