相关疑难解决方法(0)

如何将NSMutableArray转换为NSString?

我想将a(或复制?)NSMutableArray转换为a NSString.我想我的问题是我并不真正了解a的结构NSString.转换后我想将它附加到电子邮件正文中.这是我的代码:

- (IBAction)sendEmail
{
    NSLog(@"sendEmail");
    [textView resignFirstResponder];
    [textView1 resignFirstResponder];
    if ([MFMailComposeViewController canSendMail])
    {
        // set the sendTo address
        NSMutableArray *recipients = [[NSMutableArray alloc] initWithCapacity:1];
        [recipients addObject:@"example@yahoo.com"];
        MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
        controller.mailComposeDelegate = self;
        [controller setSubject:@"Iphone Game"];
        NSString *string = [string appendString:[NSString stringWithFormat:"%@", [viewArray objectAtIndex:i]]];
        [controller setMessageBody:string isHTML:NO];
        [controller setToRecipients:recipients];
        [self presentModalViewController:controller animated:YES];
        [controller release];
    }
    else 
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
 message:@"Your device is not set up for email." delegate:self …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c nsmutablearray nsarray ios

5
推荐指数
1
解决办法
7126
查看次数

如何将NSMutableArray的元素转换为NSString

我有1个NSMutableArray,我想转换数组中的任何数据将在NSString中.告诉我代码.数组只不过是NSMutableArray类的对象.

iphone cocoa

2
推荐指数
2
解决办法
2万
查看次数

标签 统计

iphone ×2

cocoa ×1

ios ×1

nsarray ×1

nsmutablearray ×1

objective-c ×1