#pragma mark - #pragma mark SMS-(IBAction)showSMSPicker:(id)sender{// The MFMessageComposeViewController class is only available in iPhone OS 4.0 or later.// So, we must verify the existence of the above class and log an error message for devices// running earlier versions of the iPhone OS. Set feedbackMsg if device doesn't support// MFMessageComposeViewController API.ClassmessageClass=(NSClassFromString(@"MFMessageComposeViewController"));if(messageClass!=nil){// Check whether the current device is configured for sending SMS messagesif([messageClasscanSendText]){[selfdisplaySMSComposerSheet];}else{[UIAlertViewquickAlertWithTitle:@"设备没有短信功能"messageTitle:nildismissTitle:@"关闭"];}}else{[UIAlertViewquickAlertWithTitle:@"iOS版本过低,iOS4.0以上才支持程序内发送短信"messageTitle:nildismissTitle:@"关闭"];}}-(void)displaySMSComposerSheet{MFMessageComposeViewController*picker=[[MFMessageComposeViewControlleralloc]init];picker.messageComposeDelegate=self;NSMutableString*absUrl=[[NSMutableStringalloc]initWithString:web.request.URL.absoluteString];[absUrlreplaceOccurrencesOfString:@"http://i.aizheke.com"withString:@"http://m.aizheke.com"options:NSCaseInsensitiveSearchrange:NSMakeRange(0,[absUrllength])];picker.body=[NSStringstringWithFormat:@"我在爱折客上看到:%@ 可能对你有用,推荐给你!link:%@",[webstringByEvaluatingJavaScriptFromString:@"document.title"],absUrl];[absUrlrelease];[selfpresentModalViewController:pickeranimated:YES];[pickerrelease];}-(void)messageComposeViewController:(MFMessageComposeViewController*)controllerdidFinishWithResult:(MessageComposeResult)result{switch(result){caseMessageComposeResultCancelled:LOG_EXPR(@"Result: SMS sending canceled");break;caseMessageComposeResultSent:LOG_EXPR(@"Result: SMS sent");break;caseMessageComposeResultFailed:[UIAlertViewquickAlertWithTitle:@"短信发送失败"messageTitle:nildismissTitle:@"关闭"];break;default:LOG_EXPR(@"Result: SMS not sent");break;}[selfdismissModalViewControllerAnimated:YES];}