{"action":"created","issue":{"url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/102","labels_url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/102/comments","events_url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/102/events","html_url":"https://github.com/Alterplay/APAddressBook/issues/102","id":111189078,"number":102,"title":"Can you tell me what is wrong?","user":{"login":"eduardobonfa","id":14893441,"avatar_url":"https://avatars.githubusercontent.com/u/14893441?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardobonfa","html_url":"https://github.com/eduardobonfa","followers_url":"https://api.github.com/users/eduardobonfa/followers","following_url":"https://api.github.com/users/eduardobonfa/following{/other_user}","gists_url":"https://api.github.com/users/eduardobonfa/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardobonfa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardobonfa/subscriptions","organizations_url":"https://api.github.com/users/eduardobonfa/orgs","repos_url":"https://api.github.com/users/eduardobonfa/repos","events_url":"https://api.github.com/users/eduardobonfa/events{/privacy}","received_events_url":"https://api.github.com/users/eduardobonfa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-13T14:14:40Z","updated_at":"2015-10-13T14:46:40Z","closed_at":null,"body":"- (void)reloadContacts {\r\n        APAddressBook *addressBook = [[APAddressBook alloc] init];\r\n        returnContact = [[NSMutableArray alloc] init];\r\n        \r\n        addressBook.fieldsMask = APContactFieldDefault;\r\n        addressBook.sortDescriptors = @[\r\n                                        [NSSortDescriptor sortDescriptorWithKey:@\"name.firstName\" ascending:YES],\r\n                                        [NSSortDescriptor sortDescriptorWithKey:@\"name.lastName\" ascending:YES]\r\n                                        ];\r\n        addressBook.filterBlock = ^BOOL(APContact *contact)\r\n        {\r\n            return contact.phones.count > 0;\r\n        };\r\n        [addressBook loadContacts:^(NSArray <APContact *> *contacts, NSError *error) {\r\n            if (!error) {\r\n                for (int i = 0 ; i < contacts.count; i++) {\r\n                    contactAP = [contacts objectAtIndex:i];\r\n                    ContactData *contactData = [[ContactData alloc] init];\r\n                    contactData.name =  contactAP.name.compositeName;\r\n                    contactData.ID = contactAP.recordID;\r\n                    for (int j = 0; j < contactAP.phones.count; j++) {\r\n                        APPhone *contactPhone = [contactAP.phones objectAtIndex:j];\r\n                        NSString *phoneNumber = contactPhone.number;\r\n                        [contactData.phoneNumbers addObject:phoneNumber];\r\n                    }\r\n                    [returnContact addObject:contactData];\r\n                }\r\n            } else if (error) {\r\n                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil\r\n                                                                    message:error.localizedDescription\r\n                                                                   delegate:nil\r\n                                                          cancelButtonTitle:@\"OK\"\r\n                                                          otherButtonTitles:nil];\r\n                [alertView show];\r\n            }\r\n        }];\r\n"},"comment":{"url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/comments/147737573","html_url":"https://github.com/Alterplay/APAddressBook/issues/102#issuecomment-147737573","issue_url":"https://api.github.com/repos/Alterplay/APAddressBook/issues/102","id":147737573,"user":{"login":"eduardobonfa","id":14893441,"avatar_url":"https://avatars.githubusercontent.com/u/14893441?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardobonfa","html_url":"https://github.com/eduardobonfa","followers_url":"https://api.github.com/users/eduardobonfa/followers","following_url":"https://api.github.com/users/eduardobonfa/following{/other_user}","gists_url":"https://api.github.com/users/eduardobonfa/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardobonfa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardobonfa/subscriptions","organizations_url":"https://api.github.com/users/eduardobonfa/orgs","repos_url":"https://api.github.com/users/eduardobonfa/repos","events_url":"https://api.github.com/users/eduardobonfa/events{/privacy}","received_events_url":"https://api.github.com/users/eduardobonfa/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T14:46:40Z","updated_at":"2015-10-13T14:46:40Z","body":"I'm trying to load the contacts and save in a NSMutableArray, but it isn't working.\r\n\r\nAPContact* contactAP;\r\nNSMutableArray* returnContact;"}}