Vcard is a pretty standard way for exchanging electronic business cards information. iPhone or any other smartphone supports VCard (.vcf) files and imports the contact details (first name, last name, email, phone, address etc.) into the Address book for that contact. The following snippets show how to create a VCard as an NSString, then this text could be serialized into a file with extension (vcf) and which further can be sent to another phone or email as an attachment.


- (NSString *)vCardRepresentation
  NSMutableArray *mutableArray = [[NSMutableArray alloc] init];

  [mutableArray addObject:@"BEGIN:VCARD"];
  [mutableArray addObject:@"VERSION:3.0"];

  [mutableArray addObject:[NSString stringWithFormat:@"FN:%@",]];

  [mutableArray addObject:[NSString stringWithFormat:@"ADR:;;%@",
                           [self addressWithSeparator:@";"]]];

  if ( != nil)
    [mutableArray addObject:[NSString stringWithFormat:@"TEL:%@",]];

  [mutableArray addObject:[NSString stringWithFormat:@"GEO:%g;%g",
                           self.latitudeValue, self.longitudeValue]];

  [mutableArray addObject:[NSString stringWithFormat:@"URL:http://%@",

  [mutableArray addObject:@"END:VCARD"];

  NSString *string = [mutableArray componentsJoinedByString:@"n"];

  [mutableArray release];

  return string;