开发者

presenting MFMailComposeViewController modally from iPhone addressbook

I am building an iPhone app which sends email to contacts from address-book.

After selecting the email-address from a persons contact...i want to use MFMailComposeViewController and present the MailComposeViewController modally, but on tap to email field o开发者_如何学Cf contact it launches the mail application....

how can i discard the default functionality of switching to mail app and use MFMailComposeViewController instead?


In the delegate method

- (BOOL)personViewController:(ABPersonViewController *)personViewController 
shouldPerformDefaultActionForPerson:(ABRecordRef)person 
                           property:(ABPropertyID)property 
                         identifier:(ABMultiValueIdentifier)identifierForValue

return NO and present the MailComposeViewController from there when property==kABPersonEmailProperty.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜