使用未解析的标识符'contentURL'。我得到了这个错误

时间:2017-03-15 18:18:34

标签: swift3 fbsdk fbsdksharekit

function fetchDataWeek( startDay, endDay ) {
    startDay = makeDateString(startDay);
    endDay = makeDateString(endDay);
    url = "https://api" + startDay + endDay + ".json";
    $.ajax({
        url: url,
        success: function(result){
            parseHistory(result);
            _promise.resolve(result);
        }
    });            
}

1 个答案:

答案 0 :(得分:0)

您必须创建contentURL之类的imageURL

let contentURL = NSURL(string: "https://www.facebook.com/FacebookDevelopers") 
let content = FBSDKShareLinkContent()
content.contentURL = contentURL
...

let imageURL = NSURL(string: "http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg")
shareButton.shareContent = FBSDKShareLinkContent(contentURL:contentURL, contentTitle ...