Reading User Profiles using an Affiliate Object


/ Published in: Objective C

Iterating over an array of affiliates and reading Profile objects off the server.


Copy this code and paste it in your HTML
  1. for(Affiliate *affiliate in profile.affiliates)
  2.  
  3. {
  4.  
  5. Profile *affiliateProfile = [[Profile alloc]init];
  6.  
  7. affiliateProfile.emailScope=ScopePublic;
  8.  
  9. affiliateProfile.entityId=affiliate.peerId;
  10.  
  11. [self readUnityObject:affiliateProfile withCompletionBlock:^(id object, bool success, NSString *errorMessage)
  12.  
  13. {
  14.  
  15. if (success)
  16.  
  17. {
  18.  
  19. NSLog(@"Got this profile name: %@",((Profile *)object).name);
  20.  
  21. [self.allContacts setObject:((Profile *)object) forKey:[NSNumber numberWithInt:((Profile *)object).entityId]];
  22.  
  23. }
  24.  
  25. else
  26.  
  27. {
  28.  
  29. NSLog(@"%@",errorMessage);
  30.  
  31. }
  32.  
  33. }];
  34.  
  35. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.