Good Afternoon,
Today I am having some issues with parse.
I have created a UISearchController, loaded my users from parse so I can search for individual ones and I have added a following and unfollowing feature.
My Problem is when I search for a specific user and try to follow him: So I search for a specific user say "test" it shows up as it should, but when I click follow and then go back to parse to see if "I" have followed test I can a different result.
It says I have followed for example "tester" which was the first user created. Its seeming to follow the Cell and now the userId...
After that I manged to get the users in alphabetical order, but same problem here except it follows the first user in alphabetical order for example if I have a username that begins with an "A"!
I'm not sure how to fix this issue, so I'm hoping someone here does..I accept and appreciate all kind of tips and answers!
You need to check if the UISearchController
is active inside of didSelectRowAtIndexPath
. Right now you are only selecting from the users
array instead of from the searchResults
array.
I also highly recommend refactoring your code away from using objectIds and use pointers. It is much easier to query against and work with pointers rather than directly accessing their objectIds.
Here's a link to another question that I've previously answered where I give a complete example of using a UISearchController
to search by usernames in Parse.. Hope this helps!