주소록에서 각 연락처에 대한 이미지 URL을 가져와야합니다. 이제 이미지를 얻을 수 있지만 문제는 특정 사람에 대한 이미지의 자산 URL을 가져와야한다는 것입니다. 현재 연락처 이미지를 받고 있습니다.
[UIImage imageWithData:(__bridge NSData *)ABPersonCopyImageData(person)]
특정 이미지에 대한 자산 URL을 얻을 수 있도록 도와주세요. 감사
데이터의 로컬 복사본을 만든 다음 해당 로컬 복사본에 대한 참조를 데이터베이스에 저장해야한다고 생각합니다.
//create a fileName perhaps based on the contact name or a GUID
NSError *err;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);//find the cache dir. You might want to consider using the doc dir instead
NSString * path = [paths objectAtIndex:0];
path = [path stringByAppendingPathComponent:fileName];
[imgData writeToFile:path options:NSDataWritingAtomic error:&err];
if(!err)
{
///save path to the DB
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다