iOS Parse: Add / Get array of PFUsers -
in app, have playlist, want share friend. in parse save playlist objects , user created playlist save key: @"user_id"
.
now changed pointer _user array of users sharing future. saved in @"user_id"
column, array of users (users have access 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 need check if current user using playlist mentioned above. how can check if user object in @"user_id"
column array?
what you're going want first array column in parse. want traverse through using in loop:
for(pfuser *user in arrayyougotfromparse) { if(user == [pfuser currentuser]) //current user in array }
Comments
Post a Comment