-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXSABContact.m
More file actions
35 lines (30 loc) · 892 Bytes
/
Copy pathXSABContact.m
File metadata and controls
35 lines (30 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// XSABContact.m
// SkypeToAddressBook
//
// Created by Xavi Aracil on 19/08/10.
// Copyright 2010 xaracSoft (Xavi Aracil Diaz). All rights reserved.
//
#import "XSABContact.h"
#import <AddressBook/AddressBook.h>
@implementation XSABContact
@synthesize uniqueId;
@synthesize fullName;
@synthesize skypeName;
-(id) initWithPerson:(ABPerson *)person skypeProperty:(NSString *)skypeProperty {
self = [super init];
if (self != nil) {
self.uniqueId = [person uniqueId];
self.fullName = [[self class] fullNameForPerson:person];
self.skypeName = [person valueForProperty:skypeProperty];
}
return self;
}
#pragma mark -
#pragma mark Class Methods
+(NSString *) fullNameForPerson:(ABPerson *)person {
return [NSString stringWithFormat:@"%@ %@",
[person valueForProperty:kABFirstNameProperty],
[person valueForProperty:kABLastNameProperty]];
}
@end