FBSDKGraphRequest - 结果=无

时间:2016-03-29 15:15:15

标签: ios xcode swift

我安装了新版本的Xcode(7.2到7.3),现在我收到一个错误(在解开Optional值时意外发现nil。)

错误代码:

Error Code 8: error loading helper function: error: Couldn't lookup symbols:
      _memmove

我的代码:

FBSDKGraphRequest.init(graphPath: "/{user_id}/feed", parameters: ["fields":" id, message, picture, data, created_time"]).startWithCompletionHandler { (connection, result, error) -> Void in

//if error == 0 {
var resultdict = result as! NSDictionary!
            var data: NSArray = resultdict.objectForKey("data") as! NSArray

            for i in 0..<data.count {
                let valueDict: NSDictionary = data[i] as! NSDictionary
                let message = valueDict.objectForKey("message") as! String!

                let created_time = valueDict.objectForKey("created_time") as! String
                var df = NSDateFormatter()
                df.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZ"
                var date = df.dateFromString(created_time)
                df.dateFormat = "eee MMM dd yyyy"
                var dateStr = df.stringFromDate(date!)

                let picture = valueDict.objectForKey("picture") as! String
                let pictureURL = NSURL(string: picture)
                let pictureData = NSData(contentsOfURL: pictureURL!)
            }
           // }
        }

在版本7.2上它工作,但现在我收到此错误,我的结果为零。我试图找到一个解决方案(在这个网站上使用了搜索功能并找到了很多解决方案),但我总是得到同样的错误。

有任何帮助吗?

更新1:我重新安装了Xcode,现在我有了一个新的错误:

fatal error: unexpectedly found nil while unwrapping an Optional value
Printing description of error:
expression produced error: /var/folders/_4/qjkhmjw90ml2z5fd_gvmb23w0000gn/T/lldb/2724/expr2.swift:1:80: error: use of undeclared type 'Foundation'
$__lldb__DumpForDebugger(Swift.UnsafePointer<Swift.ImplicitlyUnwrappedOptional<Foundation.NSError>>(bitPattern: 0x110bcbfa0).memory)
                                                                               ^~~~~~~~~~
/var/folders/_4/qjkhmjw90ml2z5fd_gvmb23w0000gn/T/lldb/2724/expr2.swift:1:45: note: while parsing this '<' as a type parameter bracket
$__lldb__DumpForDebugger(Swift.UnsafePointer<Swift.ImplicitlyUnwrappedOptional<Foundation.NSError>>(bitPattern: 0x110bcbfa0).memory)

更新2:修正了......

FBSDKGraphRequest.init(graphPath: "/{user_id}/feed?access_token=ACCESS_TOKEN", parameters: ["fields":" id, message, picture, data, created_time"]).startWithCompletionHandler { (connection, result, error) -> Void in

0 个答案:

没有答案