Reputation: 29
I have .Vcf File(Url) which is coming from web service. and i want to open it in my view controller.
Anyone can help me for this.
Thanks.
Upvotes: 0
Views: 558
Reputation: 29
This is the Solution
NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[self.totalData valueForKey:@"file"]]]];
NSArray *contactList = [NSArray arrayWithArray:[CNContactVCardSerialization contactsWithData:data error:nil]];
CNContact *contact;
contact=[contactList objectAtIndex:0];
NSLog(@"%@",contact.givenName);
NSLog(@"%@",contact.familyName);
Upvotes: 1