gpt4 book ai didi

iphone - 应用程序因 SKPSMTPMessage 类而崩溃

转载 作者:行者123 更新时间:2023-11-29 03:47:22 25 4
gpt4 key购买 nike

所以我对这门课有一个严重的问题......

目前,当用户实际发送电子邮件时,ActivityIndi​​cator 显示...太棒了!!!而且 UI 没有被卡住...太酷了!

问题是,如果用户推送到另一个 View Controller ,而该 View Controller 实际上关闭了发送电子邮件 View Controller ,则应用程序崩溃...我注意到我必须等到第二个“*** 停止看门狗 ***”字符串已被记录...以及“S: 221 2.0.0 关闭连接 i16sm31117760pag.18 - gsmtp

这是完整的日志,

013-07-09 09:50:50.655 PowerOneApp[29380:c07] C: Attempting to connect to server at: smtp.gmail.com:25
2013-07-09 09:50:50.752 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.752 PowerOneApp[29380:c07] S: 220 mx.google.com ESMTP nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:50.752 PowerOneApp[29380:c07] C: EHLO localhost
2013-07-09 09:50:50.752 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:50.788 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.788 PowerOneApp[29380:c07] S: 250-mx.google.com at your service, [70.89.67.1]
2013-07-09 09:50:50.788 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.788 PowerOneApp[29380:c07] S: 250-SIZE 35882577
2013-07-09 09:50:50.788 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.789 PowerOneApp[29380:c07] S: 250-8BITMIME
2013-07-09 09:50:50.789 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.789 PowerOneApp[29380:c07] S: 250-STARTTLS
2013-07-09 09:50:50.789 PowerOneApp[29380:c07] C: STARTTLS
2013-07-09 09:50:50.790 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:50.790 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.790 PowerOneApp[29380:c07] S: 250 ENHANCEDSTATUSCODES
2013-07-09 09:50:50.832 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:50.832 PowerOneApp[29380:c07] S: 220 2.0.0 Ready to start TLS
2013-07-09 09:50:50.832 PowerOneApp[29380:c07] Beginning TLSv1...
2013-07-09 09:50:50.832 PowerOneApp[29380:c07] C: EHLO localhost
2013-07-09 09:50:51.102 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:51.140 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.140 PowerOneApp[29380:c07] S: 250-mx.google.com at your service, [70.89.67.1]
2013-07-09 09:50:51.140 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.140 PowerOneApp[29380:c07] S: 250-SIZE 35882577
2013-07-09 09:50:51.141 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.141 PowerOneApp[29380:c07] S: 250-8BITMIME
2013-07-09 09:50:51.141 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.141 PowerOneApp[29380:c07] S: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
2013-07-09 09:50:51.141 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.142 PowerOneApp[29380:c07] S: 250 ENHANCEDSTATUSCODES
2013-07-09 09:50:51.142 PowerOneApp[29380:c07] C: AUTH PLAIN AGpzZXR0aW5nMzIARm9vdGJhbGwzMyE=
2013-07-09 09:50:51.142 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:51.983 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:51.983 PowerOneApp[29380:c07] S: 235 2.7.0 Accepted
2013-07-09 09:50:51.983 PowerOneApp[29380:c07] C: MAIL FROM:<jsetting32@icloud.com> BODY=8BITMIME
2013-07-09 09:50:51.983 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:52.025 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:52.025 PowerOneApp[29380:c07] S: 250 2.1.0 OK nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:52.025 PowerOneApp[29380:c07] C: RCPT TO:<jsetting32@gmail.com>
2013-07-09 09:50:52.025 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:52.069 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:52.069 PowerOneApp[29380:c07] S: 250 2.1.5 OK nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:52.069 PowerOneApp[29380:c07] C: DATA
2013-07-09 09:50:52.069 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:53.220 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:53.220 PowerOneApp[29380:c07] S: 354 Go ahead nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:53.221 PowerOneApp[29380:c07] *** starting long watchdog ***
2013-07-09 09:50:54.700 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:54.700 PowerOneApp[29380:c07] S: 250 2.0.0 OK 1373388654 nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:54.700 PowerOneApp[29380:c07] C: QUIT
2013-07-09 09:50:54.701 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:50:54.734 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:50:54.734 PowerOneApp[29380:c07] S: 221 2.0.0 closing connection nr8sm18121079pbc.6 - gsmtp
2013-07-09 09:50:58.656 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.190 PowerOneApp[29380:c07] C: Attempting to connect to server at: smtp.gmail.com:25
2013-07-09 09:51:11.276 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.276 PowerOneApp[29380:c07] S: 220 mx.google.com ESMTP i16sm31117760pag.18 - gsmtp
2013-07-09 09:51:11.276 PowerOneApp[29380:c07] C: EHLO localhost
2013-07-09 09:51:11.277 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:11.317 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.318 PowerOneApp[29380:c07] S: 250-mx.google.com at your service, [70.89.67.1]
2013-07-09 09:51:11.318 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.318 PowerOneApp[29380:c07] S: 250-SIZE 35882577
2013-07-09 09:51:11.318 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.318 PowerOneApp[29380:c07] S: 250-8BITMIME
2013-07-09 09:51:11.319 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.319 PowerOneApp[29380:c07] S: 250-STARTTLS
2013-07-09 09:51:11.319 PowerOneApp[29380:c07] C: STARTTLS
2013-07-09 09:51:11.319 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:11.320 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.320 PowerOneApp[29380:c07] S: 250 ENHANCEDSTATUSCODES
2013-07-09 09:51:11.354 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.354 PowerOneApp[29380:c07] S: 220 2.0.0 Ready to start TLS
2013-07-09 09:51:11.355 PowerOneApp[29380:c07] Beginning TLSv1...
2013-07-09 09:51:11.355 PowerOneApp[29380:c07] C: EHLO localhost
2013-07-09 09:51:11.644 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:11.680 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.680 PowerOneApp[29380:c07] S: 250-mx.google.com at your service, [70.89.67.1]
2013-07-09 09:51:11.680 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.680 PowerOneApp[29380:c07] S: 250-SIZE 35882577
2013-07-09 09:51:11.680 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.681 PowerOneApp[29380:c07] S: 250-8BITMIME
2013-07-09 09:51:11.681 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.681 PowerOneApp[29380:c07] S: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
2013-07-09 09:51:11.681 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:11.682 PowerOneApp[29380:c07] S: 250 ENHANCEDSTATUSCODES
2013-07-09 09:51:11.682 PowerOneApp[29380:c07] C: AUTH PLAIN AGpzZXR0aW5nMzIARm9vdGJhbGwzMyE=
2013-07-09 09:51:11.682 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:12.462 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:12.463 PowerOneApp[29380:c07] S: 235 2.7.0 Accepted
2013-07-09 09:51:12.463 PowerOneApp[29380:c07] C: MAIL FROM:<jsetting32@icloud.com> BODY=8BITMIME
2013-07-09 09:51:12.463 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:12.502 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:12.503 PowerOneApp[29380:c07] S: 250 2.1.0 OK i16sm31117760pag.18 - gsmtp
2013-07-09 09:51:12.503 PowerOneApp[29380:c07] C: RCPT TO:<jsetting32@gmail.com>
2013-07-09 09:51:12.503 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:12.544 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:12.544 PowerOneApp[29380:c07] S: 250 2.1.5 OK i16sm31117760pag.18 - gsmtp
2013-07-09 09:51:12.544 PowerOneApp[29380:c07] C: DATA
2013-07-09 09:51:12.544 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:13.102 PowerOneApp[29380:c07] Let us know about a broken feature
2013-07-09 09:51:13.289 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:13.289 PowerOneApp[29380:c07] S: 354 Go ahead i16sm31117760pag.18 - gsmtp
2013-07-09 09:51:13.290 PowerOneApp[29380:c07] *** starting long watchdog ***
2013-07-09 09:51:14.751 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:14.751 PowerOneApp[29380:c07] S: 250 2.0.0 OK 1373388674 i16sm31117760pag.18 - gsmtp
2013-07-09 09:51:14.751 PowerOneApp[29380:c07] C: QUIT
2013-07-09 09:51:14.751 PowerOneApp[29380:c07] *** starting short watchdog ***
2013-07-09 09:51:14.792 PowerOneApp[29380:c07] *** stopping watchdog ***
2013-07-09 09:51:14.793 PowerOneApp[29380:c07] S: 221 2.0.0 closing connection i16sm31117760pag.18 - gsmtp

现在,我“非常快”退出发送电子邮件的 View ,它继续发送电子邮件,然后我收到此消息*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“- [__NSCFType messageSent:]: 无法识别的选择器发送到实例 0xa0a8e50'

当我使用[testMsg PerformSelectorOnBackgroundThread:@selector(send) withObject:nil];时会发生这种情况

但是当我使用 [testMsg PerformSelectorOnMainThread:@selector(send) withObject:nil waitUntilDone:YES]; 时,我遇到了与首先发布的日志语句相同的问题...

抱歉我的措辞很糟糕,但我只是对这个错误有点沮丧:(。

最佳答案

我猜这个错误不在于通过 SMTP 发送邮件。似乎在调用 messageSent: delegate 方法之前委托(delegate)对象已被释放。

我的建议是在应用程序委托(delegate)中执行 SKPSMTPMessage 发送操作。如果您不希望 SMTP 消息发送句柄位于应用程序委托(delegate)中,请保留您的委托(delegate)对象直到邮件已发送,或者在委托(delegate)对象被释放时将 SKSMTPMessage 的委托(delegate)设置为 nil。

希望对你有帮助

关于iphone - 应用程序因 SKPSMTPMessage 类而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17554219/

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