gpt4 book ai didi

iphone - iphone sdk 中电子邮件对话框未打开

转载 作者:行者123 更新时间:2023-11-29 03:58:16 25 4
gpt4 key购买 nike

在我的应用程序中,我使用 PersonPicker View 从地址框中获取电子邮件 ID。

当我选择任何电子邮件 ID 时,我尝试打开电子邮件对话框。但它会立即打开和关闭。

我无法解决这个问题。

我从 Here 获得了代码

我的代码如下:

-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{

// Get the first and the last name. Actually, copy their values using the person object and the appropriate
// properties into two string variables equivalently.
// Watch out the ABRecordCopyValue method below. Also, notice that we cast to NSString *.
NSString *firstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSString *lastName = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);

// Compose the full name.
NSString *fullName = @"";
// Before adding the first and the last name in the fullName string make sure that these values are filled in.
if (firstName != nil) {
fullName = [fullName stringByAppendingString:firstName];
}
if (lastName != nil) {
fullName = [fullName stringByAppendingString:@" "];
fullName = [fullName stringByAppendingString:lastName];
}


// Get the multivalue e-mail property.
CFTypeRef multivalue = ABRecordCopyValue(person, property);

// Get the index of the selected e-mail. Remember that the e-mail multi-value property is being returned as an array.
CFIndex index = ABMultiValueGetIndexForIdentifier(multivalue, identifier);

// Copy the e-mail value into a string.
email = (NSString *)ABMultiValueCopyValueAtIndex(multivalue, index);
NSLog(@"%@",email);
// Create a temp array in which we'll add all the desired values.
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
[tempArray addObject:fullName];

// Save the email into the tempArray array.
[tempArray addObject:email];


// Now add the tempArray into the contactsArray.
[contactsArray addObject:tempArray];
NSLog(@"%@",contactsArray);
// Release the tempArray.
[tempArray release];

// Reload the table to display the new data.
[table reloadData];

// Dismiss the contacts view controller.
[contacts dismissModalViewControllerAnimated:YES];
[contacts release];


MFMailComposeViewController* Apicker = [[MFMailComposeViewController alloc] init];
if (Apicker != nil)
{

[Apicker setSubject:@""];
NSString * someString = nil;
someString=@"<a href=\"https://www.google.com\">Google</a>";
[Apicker setMessageBody:someString isHTML:YES];

NSArray *toRecipients = [NSArray arrayWithObjects:email, nil];
[Apicker setToRecipients:toRecipients];

Apicker.mailComposeDelegate = self;
[self presentModalViewController:Apicker animated:YES];
[Apicker release];

}



return NO;
}

我认为这可能是解雇和呈现模态视图的问题。

最佳答案

您的解雇和出席的问题是两者重叠。 -- 忽略它,然后像你一样显示它,但你遇到了一个问题,因为这些东西是动画的。不要在那里设置动画或将预设延迟到解雇后

关于iphone - iphone sdk 中电子邮件对话框未打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16212550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com