2

I have written an iOS app that uses Parse.com. When I need to change the information about a user I use refreshInBackgroundWithBlock. I am now writing the app for Mac OS X but I do not seem to be able to use refreshInBackgroundWithBlock. Any Suggestions?

Here is the code below.

//Refresh the User Info
currentUser.refreshInBackgroundWithBlock { (object, error) -> Void in
//Fetch the User Info
currentUser.fetchIfNeededInBackgroundWithBlock { (result, error) -> Void in
    //Check if the comments read is nil
    if object.objectForKey("commentsRead") === nil {
         println("Comments Read is empty")                     
    } else {                       
         var currentRead:[Int] = []
         //If not empty assign the array to the value
         currentRead = object.objectForKey("commentsRead") as Array
         currentRead.append(0)
         var user = PFUser.currentUser()
         user.setObject(currentRead, forKey: "commentsRead")
         user.saveInBackgroundWithBlock { (result, error) -> Void in
         println("Completed!")
     }

}
6
  • 1
    What does Parse's documentation say? Commented Apr 5, 2015 at 23:35
  • It seems to be the same for iOS and OSX. On the Mac I am seeing 'PFUser' does not have a member named 'refreshInBackgroundWithBlock'. Commented Apr 5, 2015 at 23:36
  • I'd highly recommend actually posting your actual code that's generating the error. Commented Apr 5, 2015 at 23:37
  • I have added the code above. Commented Apr 5, 2015 at 23:43
  • Refresh is deprecated, use fetch Commented Apr 6, 2015 at 9:34

1 Answer 1

2

According to the parse doc, refreshInBackgroundWithBlock is deprecated and replaced by fetchInBackgroundWithBlock (See this)

So you don't need to call refreshInBackgroundWithBlock.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.