Parse.com : Retrieve Boolean Value in TableViewCell

后端 未结 1 572
太阳男子
太阳男子 2021-01-27 15:24

Parse.com I\'m using in my project . In my view controller I have a searchbar that fetches data from a class different from the one in which there is a Boolean value that I need

相关标签:
1条回答
  • 2021-01-27 16:04

    You're approaching your problem in the wrong way by using

    if ( [ [object objectForKey : @ " RICHIESTA_IN_ATTESA "] boolValue ] )
    

    because that means that the users need to know if they are the friend of the current user. This is the wrong way round. You current user should have a list of its current friends (either an array of object ids or relationships in Parse). Your table view controller should also have access to the current user. Then, you write the code to show / hide the buttons as:

    Note: currentUserFriends is an array of user object ids built from the relationship / information on the current user

    [cell.FFUserButton setHidden:([currentUserFriends containsObject: object.objectId])];
    
    0 讨论(0)
提交回复
热议问题