我正在尝试从 iPad 上的用户联系人访问主页/网站。我实际上是在尝试修改用作 Adobe Air 原生扩展的现有脚本 - https://github.com/memeller/ContactEditor/blob/master/ContactEditorXCode/ContactEditor.m
我对 Objective-C/xCode 很陌生,所以我真的很难让这个额外的字段返回......请有人帮帮我。
FREObject homepagesArray = NULL;
FRENewObject((const uint8_t*)"Array", 0, NULL, &homepagesArray, nil);
ABMultiValueRef homepages = ABRecordCopyValue(person, kABPersonHomePageLabel);
if(homepages)
{
for (CFIndex k=0; k < ABMultiValueGetCount(homepages); k++) {
NSString* homepage = (__bridge NSString*)ABMultiValueCopyValueAtIndex(homepages, k);
DLog(@"Adding homepage: %@",homepage);
FRENewObjectFromUTF8(strlen([homepage UTF8String])+1, (const uint8_t*)[homepage UTF8String], &retStr);
FRESetArrayElementAt(homepagesArray, k, retStr);
//[email release];
}
CFRelease(homepages);
FRESetObjectProperty(contact, (const uint8_t*)"homepages", homepagesArray, NULL);
}
else
FRESetObjectProperty(contact, (const uint8_t*)"homepages", NULL, NULL);
retStr=NULL;