我有一些Objective-C代码,如:
ABAddressBookRef addressBook;
CFErrorRef error = NULL;
addressBook = ABAddressBookCreate();
ABRecordRef group = ABGroupCreate();
ABRecordSetValue(group, kABGroupNameProperty,@"My Group", &error);
ABRecordRef person = ABPersonCreate();
ABRecordSetValue(person,kABPersonFirstNameProperty,@"Huy 1111111",&error);
ABRecordSetValue(person,kABPersonLastNameProperty,@"AseDra",&error);
ABGroupAddMember(group, person, &error);
ABAddressBookAddRecord(addressBook, group, &error);
ABAddressBookSave(addressBook,&error);
Run Code Online (Sandbox Code Playgroud)
它运行正常,没有错误,组添加到模拟器地址簿但人没有添加到Simunator地址簿.谁能告诉我哪里错了?
我有一个模态视图控制器名称:ComposeMessageViewController.和主视图控制器名称:MainViewController.在MainViewController中,我将URL映射到ComposeMessageViewController,如下所示:
[map from:@"up://home/messages/compose_message/" toModalViewController:[ComposeMessageViewController class]];
Run Code Online (Sandbox Code Playgroud)
在MainViewController中,我调用此模态视图:
TTURLAction *urlAction = [[TTURLAction actionWithURLPath:@"up://home/messages/compose_message/"] applyAnimated:YES];
[[TTNavigator navigator] openURLAction:urlAction];
Run Code Online (Sandbox Code Playgroud)
但是当我完成它时,我不知道如何删除(解散)ComposeMessageViewController.有人可以帮帮我吗?
我有2行代码:
private static final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, null, null, null);
Run Code Online (Sandbox Code Playgroud)
在哪里找到这个游标的列表?
任何人都可以向我解释一下此图 
在Dalvik上运行的Android应用程序如何从VM调用本机lib?
我有这样的主要功能:
void main()
{
char *s;
inputString(s);
printf("%s",s);
}
Run Code Online (Sandbox Code Playgroud)
和inputString函数:
void inputString(char *&s)
{
//Some code line to input a string and set s point to this string
}
Run Code Online (Sandbox Code Playgroud)
是否有一个函数自动malloc内存足够存储字符串输入(我需要在inputString函数中输入字符串).