Segue Jump
#pragma mark-navigation
In a storyboard-based application, you'll often want to do a little preparation before navigation
-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) sender
{
Get The new view controller using [Segue Destinationviewcontroller].
Pass the selected object to the new view controller.
UITableViewCell * cell = sender;
Nsindexpath * Indexpath = [self. Devicetableview Indexpathforcell:cell];
Devicedetailviewcontroller * DDVC = Segue.destinationviewcontroller;
Ddvc.devices = [Self.device objectForKey:cell.textLabel.text];
}
Storyboard Jump
Addsceneviewcontroller * asvc = [Self.storyboard instantiateviewcontrollerwithidentifier:@ "Asvc"];
[Self.navigationcontroller pushviewcontroller:asvc Animated:yes];
Call to bring your own mail
[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "mailto://[email protected]"];
Call Telephone Phone
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "tel://8008808888"];
Back to app after you call in iOS app
The usual way to call in the app is:
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "tel://123456789"];
When you make a call this way, the iphone interface stays on the phone interface when the user ends the call.
This allows users to automatically return to the app after the call is completed:
Uiwebview*callwebview =[[uiwebview alloc] init];
Nsurl *telurl =[nsurl urlwithstring:@ "tel:10086"];//looks like tel://or Tel: All right
[Callwebview loadrequest:[nsurlrequest Requestwithurl:telurl];
Remember to add to the view
[Self.view Addsubview:callwebview];
There is also a private method: (may not be audited)
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "telprompt://10086"];
Call SMS
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "sms://800888"];
Call your own browser safari
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "http://www.hzlzh.com"];
Call phone can pass number, call SMS can only set number, cannot initialize SMS content.
If you need to pass content, you can do the following:
Join: Messageui.framework
#import
Implement Proxy: Mfmessagecomposeviewcontrollerdelegate
Call the Sendsms function
Content, recipient list
-(void) Sendsms: (NSString *) bodyofmessage recipientlist: (Nsarray *) recipients
{
Mfmessagecomposeviewcontroller *controller = [[[[Mfmessagecomposeviewcontroller alloc] init] autorelease];
if ([Mfmessagecomposeviewcontroller Cansendtext])
{
controller.body = bodyOfMessage; controller.recipients = recipients;controller.messageComposeDelegate = self;[self presentModalViewController:controller animated:YES];
}
}
Processing the results of a response sent out
-(void) Messagecomposeviewcontroller: (Mfmessagecomposeviewcontroller *) controller didfinishwithresult: ( Messagecomposeresult) Result
{
[Self dismissmodalviewcontrolleranimated:yes];
if (result = = messagecomposeresultcancelled)
NSLog (@ "Message cancelled")
else if (result = = Messagecomposeresultsent)
NSLog (@ "Message sent")
Else
NSLog (@ "Message failed")
}
iOS Issues Summary: 2014-12-16 Segue jump + Storyboard Jump + call mail, phone, SMS, Safari,