ios - E-mail dialog box is not open in iphone sdk -
in app, fetching e-mail id address box using personpicker view.
when select e-mail id, try open e-mail dialog. open & close immediatly.
i can't able solve issue.
i got code here
my code follow:
-(bool)peoplepickernavigationcontroller:(abpeoplepickernavigationcontroller *)peoplepicker shouldcontinueafterselectingperson:(abrecordref)person property:(abpropertyid)property identifier:(abmultivalueidentifier)identifier{ // first , last name. actually, copy values using person object , appropriate // properties 2 string variables equivalently. // watch out abrecordcopyvalue method below. also, notice cast nsstring *. nsstring *firstname = (nsstring *)abrecordcopyvalue(person, kabpersonfirstnameproperty); nsstring *lastname = (nsstring *)abrecordcopyvalue(person, kabpersonlastnameproperty); // compose full name. nsstring *fullname = @""; // before adding first , last name in fullname string make sure these values filled in. if (firstname != nil) { fullname = [fullname stringbyappendingstring:firstname]; } if (lastname != nil) { fullname = [fullname stringbyappendingstring:@" "]; fullname = [fullname stringbyappendingstring:lastname]; } // multivalue e-mail property. cftyperef multivalue = abrecordcopyvalue(person, property); // index of selected e-mail. remember e-mail multi-value property being returned array. cfindex index = abmultivaluegetindexforidentifier(multivalue, identifier); // copy e-mail value string. email = (nsstring *)abmultivaluecopyvalueatindex(multivalue, index); nslog(@"%@",email); // create temp array in we'll add desired values. nsmutablearray *temparray = [[nsmutablearray alloc] init]; [temparray addobject:fullname]; // save email temparray array. [temparray addobject:email]; // add temparray contactsarray. [contactsarray addobject:temparray]; nslog(@"%@",contactsarray); // release temparray. [temparray release]; // reload table display new data. [table reloaddata]; // dismiss 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; }
i think may issue of dismiss & present modal view.
your problem dismiss , present 2 overlap. -- dismiss , show kinda did run problem because stuff animated. dont animate there or delay presetting till after dismissal