2012-10-23 4 views
0

주소의 모든 줄을 텍스트보기에 추가 할 수 있습니까? 지금까지는 마지막 줄만보기 adresslines에 표시됩니다.연락처에서 텍스트보기에 주소 줄을 추가 할 수 있습니까?

self.adresslines.text = (NSString *)(CFDictionaryGetValue(dictionary, kABPersonAddressCityKey)); 
     self.adresslines.text = (NSString *)(CFDictionaryGetValue(dictionary, kABPersonAddressStreetKey)); 
     self.adresslines.text = (NSString *) (CFDictionaryGetValue(dictionary, kABPersonAddressZIPKey)); 

답변

1

이제는 주소의 각 줄마다 텍스트보기의 텍스트를 설정하고 있습니다. 추가하지 않고 바꾸지 않으려 고합니다. 이런 식으로 뭔가가 작동합니다 : 물론

NSMutableString *text = [NSMutableString string];  
[text appendString:(NSString *)(CFDictionaryGetValue(dictionary, kABPersonAddressCityKey))]; 
[text appendString:@"\n"]; 
[text appendString:(NSString *)(CFDictionaryGetValue(dictionary, kABPersonAddressStreetKey))]; 
[text appendString:@"\n"]; 
[text appendString:(NSString *) (CFDictionaryGetValue(dictionary, kABPersonAddressZIPKey))]; 
self.addresslines.text = text; 

당신은 빈 줄을 피하거나 필요에 따라 다른 형식을 추가하려면 여기에 검사를 추가 할 수 있습니다.

+0

매력을 발휘하십시오! 설명해 주셔서 감사합니다. – JSA986

관련 문제