我是iPhone应用程序开发的新手。在Facebook上发帖时我收到错误please try again
。
请帮我解决这个问题
- (void)ToPostOnFB
{
NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
NSString *scoreBoard = [[NSString alloc]init];
clsChat *cls=[[clsChat alloc] init];
cls=[self.aryUserChat objectAtIndex:0];
NSString *ch= [(AppObj) removeApostropheFromString:cls.clsChatMsg callingType:@"fetch"];
score = [NSString stringWithFormat:@"%@ \n%@ %@ \n%@ %@",self.lblPeriod.text,self.lbl1.text,self.lbl2.text,self.lbl3.text,self.lbl4.text];
NSString *c = [NSString stringWithFormat:@"Post: \n%@ \nGet the app to follow your favorite teams https://goo.gl....", ch];
NSString *title = [NSString stringWithFormat:@"Post 2: \n%@ \nGet the app to follow your favorite teams https://goo.gl...\n\n%@", score,c];
dic= [NSMutableDictionary dictionaryWithObjectsAndKeys:title,@"message",nil];
NSLog(@"%@",dic);
[FBRequestConnection startWithGraphPath:@"/me/feed"
parameters:dic
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
// Link posted successfully to Facebook
NSLog(@"result: %@", result);
UIAlertView *alertShare = [[UIAlertView alloc] initWithTitle:@"" message:@"Shared Successfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertShare show];
} else {
UIAlertView *alertShare = [[UIAlertView alloc] initWithTitle:@"" message:@"Please try again" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertShare show];
NSLog(@"%@", error.description);
}
}];
}