#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMessageComposeViewController.h>
MFMessageComposeViewControllerDelegate
MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
if([MFMessageComposeViewController canSendText])
{
controller.body = @"Hello from Mugunth";
controller.recipients = [NSArray arrayWithObjects:@"12345678", @"87654321", nil];
controller.messageComposeDelegate = self;
[self presentModalViewController:controller animated:YES];
}
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
SMS.hidden = NO;
switch (result)
{
case MessageComposeResultCancelled:
SMS.text = @"Result: canceled";
NSLog(@"Result: canceled");
break;
case MessageComposeResultSent:
SMS.text = @"Result: sent";
NSLog(@"Result: sent");
break;
case MessageComposeResultFailed:
SMS.text = @"Result: failed";
NSLog(@"Result: failed");
break;
default:
SMS.text = @"Result: not sent";
NSLog(@"Result: not sent");
break;
}
[self dismissModalViewControllerAnimated:YES];
}
'개발도구 > iOS - 아이폰 개발' 카테고리의 다른 글
[ios] 푸시 한글 깨짐 (0) | 2012.11.13 |
---|---|
[ios] stream_socket_client() 에러 (1) | 2012.11.12 |
[ios] Create MD5 Hash from NSString, NSData or a File (0) | 2012.11.08 |
[ios] Interger to NSString , NSString to Integer (0) | 2012.11.08 |
[ios] tableview DataSource Delegate (0) | 2012.11.06 |