我一直在许多应用程序中使用 FacebookLikeView 类来启用应用程序中的 Facebook 个人资料喜欢。最近,代码在我放入的每个应用程序中都开始崩溃。Facebook 应用程序设置正确,一切正常。这是它给出 EXC_BAD_ACCESS 的行:
else if ([fbEvent isEqualToString:@"xfbml.render"] && [_delegate respondsToSelector:@selector(facebookLikeViewDidRender:)])
[_delegate facebookLikeViewDidRender:self];
它的实现方式如下:
_facebook = [[Facebook alloc] initWithAppId:fbAppID andDelegate:self];
self.facebookLikeView = [[FacebookLikeView alloc]init];
[self.facebookLikeView setFrame:CGRectMake(117, 140, 82, 19)];
self.facebookLikeView.delegate = self;
self.facebookLikeView.href = [NSURL URLWithString:user];
self.facebookLikeView.layout = @"button_count";
self.facebookLikeView.showFaces = NO;
[self.facebookLikeView load];