tim*_*our 8 objective-c ios imessage mfmessagecomposeviewcontroller
我有一个应用程序,用户可以通过将图像附加到MFMessageComposeViewController的实例来选择图像并将其发送给朋友.在MFMCVC视图中按下发送后,事情在某些时候按预期工作 - 带有图像的消息已成功发送给收件人,或者"消息失败"标签显示在本机iMessage客户端中的消息旁边(但在两种情况下,图像在本机客户端中都可见.但是,按下发送后的一半时间内会出现一个错误(在运行iOS 7的iPhone 4上).消息 - 附件和所有 - 消失,再也不会被看到.收件人从未收到邮件,也不会出现在iMessage的发件人邮件通道中.
我很确定这是Apple的MFMessageComposeViewController本身的一个错误,因为API很简单,我能够在单独的演示应用程序中可靠地重现错误https://github.com/timcour/mf-message-compose- fail-demo.git.
- (void)displaySMSComposerSheet
{
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
NSData *data = [_imageDataCache objectForKey:[_imageURLs objectAtIndex:_currentIndex]];
[picker addAttachmentData:data
typeIdentifier:(NSString *)kUTTypeGIF
filename:@"share.gif"];
if (![self.recipientTextField.text isEqualToString:@""]) {
picker.recipients = [NSArray arrayWithObject:self.recipientTextField.text];
}
picker.body = [NSString stringWithFormat:@"image: %i", _currentIndex];
[self presentViewController:picker animated:YES completion:NULL];
}
Run Code Online (Sandbox Code Playgroud)
在很多成功和失败的情况下观察用户界面之后,在强调操作系统加剧的组合视图中似乎是一种竞争条件 - 不确定它是内存还是CPU压力(或两者兼而有之?).在任何情况下,当发送成功时,在选择联系人之后立即用其相应会话的内容填充消息信道的内容,明显地将新消息附加到结尾.但是当错误表面和消息消失时,对话的先前消息通常仅在按下发送按钮后才出现,而不显示新消息.如果这确实是竞争条件,那么一个猜测是它是作曲家VC的消息提取机制和-viewDidLoad.
有没有人在此之前遇到过这种情况并且/或者知道某种解决方法?我将向苹果提交一份错误报告,但我想找到一个不包括等待Apple修复的解决方案.
笔记:
iPhone 4和iPhone 5s上的消息最常消失,但iPod touch第5代(所有运行的iOS 7.0.2)很少消失.
使用iPhone 4上的https://github.com/timcour/mf-message-compose-fail-demo.git应用程序,通过尽可能快地将20张图像发送给同一个人,可以最轻松地复制该错误.
有一个单独的(但可能是相关的)错误.在MFMCVC视图中选择输入联系人的电子邮件地址后,vc将确定是否应发送iMessage或MMS.在测试期间的某些时间,它做出了错误的决定,并尝试将消息作为MMS发送,尽管收件人iMessage帐户没有与之关联的电话号码.这导致向发件人发送一条消息,就好像它已成功发送,但实际上无法到达目的地.
这似乎并不是许多用户向Apple抱怨的"iMessage无法发送消息"的错误.
更新:
以下是消息消失且无法发送时记录的堆栈跟踪:
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] ****** Failed to complete all history queries in a blocking request: (
"********-****-****-****-************"
)
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 1 IMFoundation 0x0000000193acb948 IMLogBacktraceToDepth + 80
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 2 IMCore 0x00000001939d1df8 _NSStringFromIMMessageError + 22604
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 3 IMCore 0x00000001939c7670 IMPersonStatusComparator + 261116
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 4 ChatKit 0x00000001923c96b8 <redacted> + 240
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 5 ChatKit 0x00000001923933b0 <redacted> + 88
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 6 ChatKit 0x000000019237cb70 <redacted> + 996
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 7 ChatKit 0x0000000192414cdc <redacted> + 76
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 8 Foundation 0x000000018e8c0834 __NSFireDelayedPerform + 392
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 9 CoreFoundation 0x000000018dd1768c <redacted> + 28
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 10 CoreFoundation 0x000000018dd172fc <redacted> + 804
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 11 CoreFoundation 0x000000018dd15024 <redacted> + 1324
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 12 CoreFoundation 0x000000018dc55b78 CFRunLoopRunSpecific + 452
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 13 GraphicsServices 0x0000000193677830 GSEventRunModal + 168
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 14 UIKit 0x0000000190c9305c UIApplicationMain + 1156
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 15 MessagesViewService 0x000000010009bd80 MessagesViewService + 15744
Oct 21 12:09:17 Davids-iPhone MessagesViewService[2680] <Warning>: [Warning] 16 libdyld.dylib 0x000000019a25baa0 <redacted> + 4
Oct 21 12:09:20 Davids-iPhone SpringBoard[16] <Warning>: LICreateIconForImage passed NULL CGImageRef image
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3356 次 |
| 最近记录: |