0

In my app, I have an playlist, which I want to share with another friend. In parse I save the Playlist objects and from the user which created the playlist i save the key: @"user_id".

Now I changed Pointer _User to an array of Users for my sharing future. I already saved in @"user_id" column, an array of users (users which have access to the same playlist) :

[
  {
    "__type" : "Pointer",
    "className" : "_User",
    "objectId" : "teH3s20xxx"
  },
  {
    "__type" : "Pointer",
    "className" : "_User",
    "objectId" : "hgkcjHyi9T"
  },
  {
    "__type" : "Pointer",
    "className" : "_User",
    "objectId" : "K2dZTEKpIX"
  },
  {
    "__type" : "Pointer",
    "className" : "_User",
    "objectId" : "4dbmDuR6LF"
  }
]

Now I need to check if current user is using playlist mentioned above. How can I check if my user is an object in @"user_id" column array?

1
  • Could you be a little more clear with what you're asking? Commented Aug 18, 2014 at 2:40

1 Answer 1

1

What you're going to want to do is first get the array from that column in parse. Then you want to traverse through it using a for in loop:

for(PFUser *user in arrayYouGotFromParse)
{

if(user == [PFUser currentUser])
//Current user is in the array

}
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.