First, call the system phone
// Call system Call function -(void) callphonenumber{ *allstring = [NSString stringWithFormat:@ " tel:10086"]; [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:allstring];}
Second, the message function of invoking the system
// calling the system mailbox [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "mailto://[email protected] "]];
Third, safari that calls the system
[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "http://www.baidu.com" ]];
Iv. calling the system's SMS kinetic energy
1, this function to carry out some related configuration operation
1) Add Messageui.framework
2) Import header file
#import <MessageUI/MFMessageComposeViewController.h>
3) Compliance with the agreement
<MFMessageComposeViewControllerDelegate>
//call to send SMS method[Self sendsms:@"101"recipientlist:@[@"10010"]];//content, recipient list- (void) Sendsms: (NSString *) bodyofmessage recipientlist: (Nsarray *) recipients{Mfmessagecomposeviewcontroller*controller =[[Mfmessagecomposeviewcontroller alloc] init]; if([Mfmessagecomposeviewcontroller Cansendtext]) {controller.body=Bodyofmessage; Controller.recipients=recipients; Controller.messagecomposedelegate=Self ; [Self Presentviewcontroller:controller animated:yes completion:nil]; } }//processing the results of a response sent out- (void) Messagecomposeviewcontroller: (Mfmessagecomposeviewcontroller *Controller Didfinishwithresult: (messagecomposeresult) result{[self dismissviewcontrolleranimated:yes Completion:nil]; if(Result = =messagecomposeresultcancelled) NSLog (@"Message cancelled"); Else if(Result = =messagecomposeresultsent) NSLog (@"Message sent"); ElseNSLog (@"Message failed"); }
Tip: These functions of calling the system need to be tested on the real machine!
system function calls