gpt4 book ai didi

ios - wait_fences : failed to receive reply: 10004003 with MessageUI

转载 作者:行者123 更新时间:2023-12-01 16:58:36 24 4
gpt4 key购买 nike

我正在使用 MessageUI 在我的应用程序中发送短信,但是当它加载 View 时,它会在日志中输出以下内容:

wait_fences: failed to receive reply: 10004003

代码相当简单......
#define UUID_USER_DEFAULTS_KEY @"UUID" 

#import "RegisterView.h"

@implementation RegisterView

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result

{
switch (result) {
case MessageComposeResultCancelled:
NSLog(@"Cancelled");
break;
case MessageComposeResultFailed:
break;
break;
case MessageComposeResultSent:

break;
default:
break;
}

[self dismissModalViewControllerAnimated:YES];
}




-(IBAction)sendSMS:(id)sender
{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText])
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSString *deviceID = [defaults objectForKey:UUID_USER_DEFAULTS_KEY];

NSString *smsBody = [NSString stringWithFormat:@"add %@", deviceID];

controller.body = smsBody;
controller.recipients = [NSArray arrayWithObject:@"PRIVATE"];
controller.messageComposeDelegate = self;
[self presentModalViewController:controller animated:YES];
}
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

我不确定我是否真的需要对消息做任何事情,因为该应用程序运行良好......但我总是喜欢消除这些事情......那么,是什么原因造成的?

最佳答案

据我所知,这个警告是因为你试图在 viewDidAppear 之前制作一些动画。方法被调用。例如,它可以是您的消息编辑器。如果您在 viewDidLoad 中显示动画内容
,尝试在 viewDidAppear 中显示它们看看你是否仍然得到错误。

干杯!

关于ios - wait_fences : failed to receive reply: 10004003 with MessageUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9416064/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com