How to navigate back to previous view after sending sms is done in iphone?
I am new to iphone development, i have created sms application using "Text Links(sms:) and i have created the action sheets and the buttons for email, sms. On clicking sms it navigates to the another view(UIView controller) and i wrote a code for SMS.And i faced some problem ,its not removed the view properly, it doesnt goes to the previous webview properly,(Action sheets loaded in webview)
Here my code and explanation,
I have created the custom send button programmatically for sending the sms.
I a开发者_如何转开发m getting phone numbers in a textfield and stores it to one string(phone) and i display the article title on the label, it worked dynamically.
now i want to share the article title through sms. and i have one problem, (ie)if i click send button it should go to the previous view(webview) but it display another view.. so i want to go to the previous page properly ,when i clicked the send button.
And i also want to display the address book(Eg,default address book in the device) in my sms view page.Please guide me.
-(void) sendbtnclk
{
self.String = txtfield.text;
NSString *phone = String;
NSString *arttitle = articleTitle;
NSString *sms = [NSString stringWithFormat:@"sms:%@ %@",phone,arttitle];
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:sms]];
[self.view removeFromSuperview];
}
thanks,
please help me out.
I think that when you use the openURL:
method, the Text app is launched on the phone and thus the current app is dismissed.
Here is the relevant documentation.
精彩评论