嗨,我正在尝试启用 IBAction 以在用户的时间线上发布,而他们有一个活动部分。我收到一条错误消息,说明;函数“x”的隐式声明在 C99 中无效。我一直在阅读有关该问题的帖子,但没有运气,老实说,我不确定我是否做对了。我更新了我的 fb 应用程序的权限,并从 Graph API Explorer 获取了目标代码,但我不知道我是否在我的代码上正确实现了它。
这是我的发布方法:
-(void) aPost
{
NSMutableDictionary<FBGraphObject> *object =
[FBGraphObject openGraphObjectForPostWithType:@"website"
title:@"CR Taxi APP"
image:@"http://a4.mzstatic.com/us/r1000/047/Purple4/v4/05/cc/f2/05ccf23f-a409-1e73-a649-a5e6afc4e6eb/mzl.llffzfbp.175x175-75.jpg"
url:@"https://itunes.apple.com/cr/app/cr-taxi/id674226640?mt=8"
description:@"La nueva aplicación para llamar taxis!"];;
[FBRequestConnection startForPostWithGraphPath:@"{id_from_create_call}"
graphObject:object
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
// handle the result
}];
}
这是我的行动方法
- (IBAction)publishAction:(id)sender {
if ([FBSession.activeSession.permissions
indexOfObject:@"publish_actions"] == NSNotFound) {
NSArray *writepermissions = [[NSArray alloc] initWithObjects:
@"publish_stream",
@"publish_actions",
nil];
[[FBSession activeSession]requestNewPublishPermissions:writepermissions defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *aSession, NSError *error){
if (error) {
NSLog(@"Error on public permissions: %@", error);
}
else {
**not on the code //( error on this one) aPost(aSession, error);
}
}];
}
else {
// If permissions present, publish the story
**not on the code //(not an error on this one) aPost(FBSession.activeSession, nil);
}
}
请帮忙!
谢谢!