我一生无法弄清楚如何建立连接以从 ios Facebook sdk 中的帖子中删除我的喜欢。这是我喜欢连接的代码。我如何删除喜欢的?我无法建立 startForDelete 连接。
// create the connection object
FBRequestConnection *newConnection = [[FBRequestConnection alloc] init];
// create a handler block to handle the results of the request for fbid's profile
FBRequestHandler handler =
^(FBRequestConnection *connection, id result, NSError *error){
// output the results of the request
[self likeCompleted:connection thisObject:thisObject thisIndexPath:thisPath result:result error:error];
};
// vars
NSString *postString = [NSString stringWithFormat:@"%@/likes", thisObject.itemId];
FBGraphObject *graphObject = [[FBGraphObject alloc] init];
// create request
FBRequest *request = [[FBRequest alloc] initForPostWithSession:FBSession.activeSession graphPath:[NSString stringWithFormat:@"%@", postString] graphObject:graphObject];
// add the request
[newConnection addRequest:request completionHandler:handler];
// add to open conection
[openFbConnections addObject:thisObject.userId];
// if there's an outstanding connection, just cancel
[requestConnection cancel];
// keep track of our connection, and start it
requestConnection = newConnection;
[newConnection start];