2016-01-24 158 views
0
_facebookResponseCount = 0; 
[[PFUser currentUser] fetchInBackgroundWithTarget:self selector:@selector(refreshCurrentUserCallbackWithResult:error:)]; 

我想在我的Xcode上運行anyPic parse.com應用程序,但我得到的錯誤解析fetchInBackgroundWithTarget被deprecated.use WithBlock PFObject instead.I已嘗試更正它,但未能找到正確的code.Please幫助Parse.com fetchInbackground已被棄用?

回答

0

這裏是fetchIfNeededInBackgroundWithBlock的代碼:

目的-C:

[[PFUser currentUser] fetchIfNeededInBackgroundWithBlock:^(PFObject *fetchedUser, NSError *error) { 
    //Code here 
}]; 

夫特:

PFUser.currentUser()!.fetchIfNeededInBackgroundWithBlock({ 
      (fetchedUser: PFObject?, error: NSError?) -> Void in 
    // Code here   
})