我複製的代碼來自Facebook的開發者網站整合Facebook分享到我的應用程序時,「程序意外@」:複製Facebook的股票代碼
NSMutableDictionary<FBGraphObject> *object = [FBGraphObject openGraphObjectForPostWithType:@whatsyourinneragefb:inner_age
title:@Sample Inner Age
image:@https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png
url:@http://samples.ogp.me/578838518886846
description:@];;
[FBRequestConnection startForPostWithGraphPath:@"me/objects/whatsyourinneragefb:inner_age"
graphObject:object
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
// handle the result
}];
然而,「@」 @whatsyourinneragefb
之前產生錯誤"Unexpected @ in program
。此外,像@https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png
這樣的行擁有@https:白色,其餘部分突出顯示爲綠色,就像它是一條評論,所以即使上述錯誤消失,我也覺得這樣做不起作用。所以:
我該如何解決第一個錯誤?
和
是代碼的功能,或是否需要進行調整的工作?
所有幫助表示讚賞。
您從哪裏複製它? – WizKid 2014-10-09 19:47:51
我強烈建議您在提問這樣的問題之前,先閱讀*至少* Objective-C語言的基礎知識。我建議閱讀以下內容:http://stackoverflow.com/help/how-to-ask – 2014-10-09 19:50:15
我在Facebook開發人員網站的「我的應用程序」中訪問了我的應用程序,然後轉到Open Graph,然後單擊「獲取代碼」。 – 2014-10-09 19:50:49