我正在从 ABpeoplepickerNavcontroller 保存名字和姓氏,我想在保存到数组之前合并名字和姓氏,这样当我检索它时,它们会在一起。第一个代码是正在创建的对象:
// setting the first name
firstName.text = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
// setting the last name
lastName.text = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
这是我保存它的地方:
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:firstName.text];
[array addObject:lastName.text];
[array addObject:addressLabel.text];
[array writeToFile:recipient atomically:NO];
[array release];
我可以保存在一行中添加两个对象吗?或者我可以在添加到数组之前合并对象吗?
谢谢,并记录在案......这个网站和帮助我的人都很棒。
迈克尔