【问题标题】:MFMessageComposeViewController shows blank/white screenMFMessageComposeViewController 显示空白/白屏
【发布时间】:2013-02-14 19:39:03
【问题描述】:
if([MFMessageComposeViewController canSendText])
{
    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];

    controller.body = @"This is a test!";

    controller.recipients = [NSArray arrayWithObject:phones];

    controller.messageComposeDelegate = self;

    [self presentViewController:controller animated:YES completion:nil];
}

此代码使整个屏幕变为白色/空白。有什么建议吗?

【问题讨论】:

标签: ios objective-c cocoa-touch uiviewcontroller


【解决方案1】:

我遇到了同样的问题,发现我的错误。

确保您发送给 controller.recipients 的电话号码是 NSString。我已经发送了一些长的 NSInteger 并且它进入空白屏幕。

【讨论】:

    【解决方案2】:

    问题出在这一行:

    controller.recipients = [NSArray arrayWithObject:phones];
    

    这是一个格式错误的电话号码数组。不知道为什么格式错误的电话号码没有引发错误,但将其过滤掉可以解决问题。

    【讨论】:

    • 我不明白。你过滤了什么?我有同样的问题,但只有百分之几的时间会出现,而其他时间效果很好。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 2014-01-13
    • 2020-01-01
    • 2023-03-18
    相关资源
    最近更新 更多