Hi I am preparing an app where users can choose between sets of 20 tags when creating their account. The selected tags are stored in an array in the user category. I also have a section of group chat and I want to load group-chat according to the tag that the user chooses to sign in. I understand that I need to use .wherekey to filter out the result. I think existing users have to use "tag-array" and filter results as a result. Parse.com is using backend
To fulfill your needs, Follow -
1) When user is in the process of creating profiles - 1.1) Add user selected tag to NSMutableArray. 1.2) Save the tags list for user data (server / cloud).
2) After the user's signals 2.1) Load group chats in the list according to the above tags.
Example Source -
- (NSArray *) filter object: (NSArray *) Objektstags: (NSArray *) Use tags {return [Gaanupryog objects filtered: [NSPredicate predicateWithFormat: @ "tag IN% @", tag]]; } // has been given the 'object' array that you get from the server NSArray * objects = @ [@ {@ "id": @ "1a", @ "tag": @ "1"}, @ {@ "Id" @ "tag": @ "3"}, @ {@ "ID": @ "@" 2a "@" tag ": @" 2 "}, @ {@" ID ": @" 3A "@" @ "@" tag "@" 4 "} @ {@" id ": @" 2B ", @" tag "@" 5 "} @ {@" ID ": } @ "3B", @ "tag": @ "6"]; NSArray * filtered objects = [self filter objects: Objektstags: @ [@ "1", @ "3", @ "4"]] ; Anselog (@ "filtered object:% @", filtered objects) made; // Generating print them as dictionaries Is
No comments:
Post a Comment